From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753106AbbCEAJN (ORCPT ); Wed, 4 Mar 2015 19:09:13 -0500 Received: from mail-pa0-f41.google.com ([209.85.220.41]:36949 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751803AbbCEAJM (ORCPT ); Wed, 4 Mar 2015 19:09:12 -0500 Date: Thu, 5 Mar 2015 09:09:16 +0900 From: Sergey Senozhatsky To: Andrew Morton Cc: Sergey Senozhatsky , Minchan Kim , Nitin Gupta , linux-kernel@vger.kernel.org, Sergey Senozhatsky Subject: Re: [PATCH 2/2] zram: introduce automatic device_id generation Message-ID: <20150305000916.GA14927@swordfish> References: <1425478601-19141-1-git-send-email-sergey.senozhatsky@gmail.com> <1425478601-19141-3-git-send-email-sergey.senozhatsky@gmail.com> <20150304141305.06bc7cc7bdb0d8233d9aae97@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150304141305.06bc7cc7bdb0d8233d9aae97@linux-foundation.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (03/04/15 14:13), Andrew Morton 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. > sorry. sure, will take care of that next time. thanks for pointing that out. -ss > --- 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); > > _ > >