From: Minchan Kim <minchan@kernel.org>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] zram: idle memory tracking
Date: Mon, 26 Mar 2018 18:57:12 +0900 [thread overview]
Message-ID: <20180326095712.GA214483@rodete-desktop-imager.corp.google.com> (raw)
In-Reply-To: <20180326081511.GA15432@kroah.com>
On Mon, Mar 26, 2018 at 10:15:11AM +0200, Greg KH wrote:
> On Mon, Mar 26, 2018 at 03:49:51PM +0900, Minchan Kim wrote:
> > +static int zram_debugfs_register(struct zram *zram)
> > +{
> > + struct dentry *ret;
> > +
> > + if (!zram_debugfs_root)
> > + return -ENOENT;
>
> No need to care, you should not error out if debugfs is not enabled or
> not working, your code path should be identical either way. debugfs is
> not required for any functionality, so don't treat it like it matters :)
Glad to hear. It makes code much clean.
>
> > + zram->debugfs_dir = debugfs_create_dir(zram->disk->disk_name,
> > + zram_debugfs_root);
> > + if (!zram->debugfs_dir)
> > + return -ENOMEM;
>
> No need to check the return value of any debugfs call, you can always
> either use it for future debugfs calls, or ignore it.
>
> > + ret = debugfs_create_file("access_time", 0400, zram->debugfs_dir,
> > + zram, &proc_zram_access_operations);
> > + if (!ret)
> > + return -ENOMEM;
>
> Again, you shouldn't care :)
>
> > +
> > + return 0;
>
> just return void, no need to test any of this.
Thanks for the quick review, Greg.
next prev parent reply other threads:[~2018-03-26 9:57 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-26 6:49 [PATCH 1/2] zram: correct flag name of ZRAM_ACCESS Minchan Kim
2018-03-26 6:49 ` [PATCH 2/2] zram: idle memory tracking Minchan Kim
2018-03-26 8:15 ` Greg KH
2018-03-26 9:57 ` Minchan Kim [this message]
2018-03-27 0:49 ` Sergey Senozhatsky
2018-03-27 1:03 ` Minchan Kim
2018-03-27 1:13 ` Sergey Senozhatsky
2018-03-27 1:47 ` Sergey Senozhatsky
2018-03-27 2:05 ` Minchan Kim
2018-03-27 2:21 ` Sergey Senozhatsky
2018-03-27 2:26 ` Minchan Kim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180326095712.GA214483@rodete-desktop-imager.corp.google.com \
--to=minchan@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sergey.senozhatsky.work@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®