From: Daniel Wagner <dwagner@suse.de>
To: Chaitanya Kulkarni <Chaitanya.Kulkarni@wdc.com>
Cc: "linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Keith Busch <kbusch@kernel.org>, Jens Axboe <axboe@fb.com>,
Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>,
Hannes Reinecke <hare@suse.de>, Chao Leng <lengchao@huawei.com>,
Victor Gladkov <Victor.Gladkov@kioxia.com>
Subject: Re: [PATCH] nvme: Export fast_io_fail_tmo to sysfs
Date: Thu, 1 Apr 2021 09:35:40 +0200 [thread overview]
Message-ID: <20210401073540.6tsv2ib3fapnglqo@beryllium.lan> (raw)
In-Reply-To: <BYAPR04MB49658F0DDA22B253F98C6F3A867C9@BYAPR04MB4965.namprd04.prod.outlook.com>
Hi Chaitanya,
On Wed, Mar 31, 2021 at 08:34:31PM +0000, Chaitanya Kulkarni wrote:
> > WARNING: Symbolic permissions 'S_IRUGO | S_IWUSR' are not preferred. Consider using octal permissions '0644'.
>
> For now keep the current style.
Okay, I thought so too. I am just wondering if a patch for changing all
the permission sets is acceptable. I prefer the the octal permissions ;)
> > +static ssize_t nvme_ctrl_fast_io_fail_tmo_show(struct device *dev,
> > + struct device_attribute *attr, char *buf)
> > +{
> > + struct nvme_ctrl *ctrl = dev_get_drvdata(dev);
> > +
> > + if (ctrl->opts->fast_io_fail_tmo == -1)
> > + return sprintf(buf, "off\n");
> > + return sprintf(buf, "%d\n", ctrl->opts->fast_io_fail_tmo);
>
> do we need snprintf() for 2nd ?
Sure thing can do. Also here I followed the existing style. The other
store functions tend to use sprintf().
> > + err = kstrtoint(buf, 10, &fast_io_fail_tmo);
> > + if (err)
> > + return -EINVAL;
> > +
>
> since you are returning an error, you can remove next else if, this also
> removes the extra line after above return. Something like this on the top
> of yours totally untested :-
Right, same here, followed the existing style. I prepare a patch which
addresses your comments for the existing code as well.
Thanks,
Daniel
prev parent reply other threads:[~2021-04-01 7:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-31 13:12 Daniel Wagner
2021-03-31 18:01 ` Ewan D. Milne
2021-03-31 19:36 ` Sagi Grimberg
2021-03-31 19:54 ` Himanshu Madhani
2021-03-31 20:34 ` Chaitanya Kulkarni
2021-04-01 7:35 ` Daniel Wagner [this message]
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=20210401073540.6tsv2ib3fapnglqo@beryllium.lan \
--to=dwagner@suse.de \
--cc=Chaitanya.Kulkarni@wdc.com \
--cc=Victor.Gladkov@kioxia.com \
--cc=axboe@fb.com \
--cc=hare@suse.de \
--cc=hch@lst.de \
--cc=kbusch@kernel.org \
--cc=lengchao@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=sagi@grimberg.me \
/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®