From: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
To: "Greg KH <gregkh@linuxfoundation.org>
(gregkh@linuxfoundation.org)" <gregkh@linuxfoundation.org>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
"Seymour, Shane M" <shane.seymour@hp.com>,
"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
"linux-api@vger.kernel.org" <linux-api@vger.kernel.org>,
"Kai.Makisara@kolumbus.fi" <Kai.Makisara@kolumbus.fi>
Subject: Re: [PATCH] st: convert DRIVER_ATTR macros to DRIVER_ATTR_RO
Date: Thu, 25 Jun 2015 08:27:07 +0900 [thread overview]
Message-ID: <20150624232707.GA3365@swordfish> (raw)
In-Reply-To: <20150624151011.GC7925@kroah.com>
On (06/24/15 08:10), Greg KH <gregkh@linuxfoundation.org> (gregkh@linuxfoundation.org) wrote:
> On Wed, Jun 24, 2015 at 03:25:57PM +0900, Sergey Senozhatsky wrote:
> > On (06/24/15 06:10), Seymour, Shane M wrote:
> > [..]
> > >
> > > /* The sysfs driver interface. Read-only at the moment */
> > > -static ssize_t st_try_direct_io_show(struct device_driver *ddp, char *buf)
> > > +static ssize_t try_direct_io_show(struct device_driver *ddp, char *buf)
> > > {
> > > - return snprintf(buf, PAGE_SIZE, "%d\n", try_direct_io);
> > > + return sprintf(buf, "%d\n", try_direct_io);
> > > }
> >
> > a nitpick,
> >
> > per Documentation/filesystems/sysfs.txt
> >
> > :
> > : - show() should always use scnprintf().
> > :
>
> That should be rewritten to say, "don't use snprintf(), but scnprintf(),
> if you want to. Otherwise sprintf() should be fine as you obviously are
> only returning a single value to userspace"
>
Sure, that was just a nitpick. For '%d' it's totally fine, I agree.
It was more of a 'do we strictly obey the rules' thing.
-ss
prev parent reply other threads:[~2015-06-24 23:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-24 6:10 [PATCH] st: convert DRIVER_ATTR macros to DRIVER_ATTR_RO Seymour, Shane M
[not found] ` <DDB9C85B850785449757F9914A034FCB3F8E9DA4-MCKW7lC+H9ISZAcGdq5asR6epYMZPwEe5NbjCUgZEJk@public.gmane.org>
2015-06-24 6:25 ` Sergey Senozhatsky
2015-06-24 15:08 ` Greg KH <gregkh@linuxfoundation.org> (gregkh@linuxfoundation.org)
2015-06-24 15:10 ` Greg KH <gregkh@linuxfoundation.org> (gregkh@linuxfoundation.org)
2015-06-24 23:27 ` Sergey Senozhatsky [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=20150624232707.GA3365@swordfish \
--to=sergey.senozhatsky.work@gmail.com \
--cc=Kai.Makisara@kolumbus.fi \
--cc=gregkh@linuxfoundation.org \
--cc=linux-api@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=shane.seymour@hp.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.