lkml.org 
[lkml]   [2015]   [Mar]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH 2/2] zram: introduce automatic device_id generation
On Wed,  4 Mar 2015 23:16:41 +0900 Sergey Senozhatsky <sergey.senozhatsky@gmail.com> wrote:

> +static ssize_t zram_add_show(struct class *class,
> + struct class_attribute *attr,
> + char *buf)
> +{
> + int ret;
> +
> + mutex_lock(&zram_index_mutex);
> + /* read operation on zram_add is - pick up device_id
> + * automatically, add corresponding device and return
> + * that device_id back to user */
> + ret = zram_add(-1);
> + mutex_unlock(&zram_index_mutex);
> +
> + if (ret < 0)
> + return ret;
> + return scnprintf(buf, PAGE_SIZE, "%d\n", ret);
> +}

Please don't invent new commenting styles. Because doing so inevitably
creates a mixed-up mess, which is what we now have.

--- a/drivers/block/zram/zram_drv.c~zram-introduce-automatic-device_id-generation-fix
+++ a/drivers/block/zram/zram_drv.c
@@ -1281,9 +1281,10 @@ static ssize_t zram_add_show(struct clas
int ret;

mutex_lock(&zram_index_mutex);
- /* read operation on zram_add is - pick up device_id
- * automatically, add corresponding device and return
- * that device_id back to user */
+ /*
+ * read operation on zram_add is - pick up device_id automatically, add
+ * corresponding device and return that device_id back to user
+ */
ret = zram_add(-1);
mutex_unlock(&zram_index_mutex);

_



\
 
 \ /
  Last update: 2015-03-04 23:21    [W:0.136 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site