Thread (4 messages) 4 messages, 3 authors, 2015-06-24

Re: [PATCH] st: convert DRIVER_ATTR macros to DRIVER_ATTR_RO

From: "Greg KH <gregkh@linuxfoundation.org> (gregkh@linuxfoundation.org)" <gregkh@linuxfoundation.org>
Date: 2015-06-24 15:08:25
Also in: linux-scsi

On Wed, Jun 24, 2015 at 03:25:57PM +0900, Sergey Senozhatsky wrote:
On (06/24/15 06:10), Seymour, Shane M wrote:
[..]
quoted
 
 /* 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().
:
Don't believe everything you read, this change is just fine.

But, you are doing something here that you did not say you were doing in
the changelog, so for that reason, the patch should be redone.

thanks,

greg k-h
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help