All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Greg KH <gregkh@linuxfoundation.org> (gregkh@linuxfoundation.org)" <gregkh@linuxfoundation.org>
To: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Cc: "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: Wed, 24 Jun 2015 08:10:11 -0700	[thread overview]
Message-ID: <20150624151011.GC7925@kroah.com> (raw)
In-Reply-To: <20150624062557.GA10808@swordfish>

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"

Or something like that.

thanks,

greg k-h

  parent reply	other threads:[~2015-06-24 15:10 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) [this message]
2015-06-24 23:27       ` Sergey Senozhatsky

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=20150624151011.GC7925@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=Kai.Makisara@kolumbus.fi \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=sergey.senozhatsky.work@gmail.com \
    --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.