Commit 00009615 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

staging: keucr: be explicit to the sysfs file permissions

Use the DEVICE_ATTR_RW() macro to be clearer as to the permissions for
the sysfs file, making it easier to audit the code.

Cc: Al Cho <acho@novell.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 89dcefb5
...@@ -289,10 +289,7 @@ US_DO_ALL_FLAGS ...@@ -289,10 +289,7 @@ US_DO_ALL_FLAGS
***********************************************************************/ ***********************************************************************/
/* Output routine for the sysfs max_sectors file */ /* Output routine for the sysfs max_sectors file */
/* static ssize_t max_sectors_show(struct device *dev,
* show_max_sectors()
*/
static ssize_t show_max_sectors(struct device *dev,
struct device_attribute *attr, char *buf) struct device_attribute *attr, char *buf)
{ {
struct scsi_device *sdev = to_scsi_device(dev); struct scsi_device *sdev = to_scsi_device(dev);
...@@ -302,10 +299,7 @@ static ssize_t show_max_sectors(struct device *dev, ...@@ -302,10 +299,7 @@ static ssize_t show_max_sectors(struct device *dev,
} }
/* Input routine for the sysfs max_sectors file */ /* Input routine for the sysfs max_sectors file */
/* static ssize_t max_sectors_store(struct device *dev,
* store_max_sectors()
*/
static ssize_t store_max_sectors(struct device *dev,
struct device_attribute *attr, struct device_attribute *attr,
const char *buf, size_t count) const char *buf, size_t count)
{ {
...@@ -319,9 +313,8 @@ static ssize_t store_max_sectors(struct device *dev, ...@@ -319,9 +313,8 @@ static ssize_t store_max_sectors(struct device *dev,
} }
return -EINVAL; return -EINVAL;
} }
static DEVICE_ATTR_RW(max_sectors);
static DEVICE_ATTR(max_sectors, S_IRUGO | S_IWUSR, show_max_sectors,
store_max_sectors);
static struct device_attribute *sysfs_device_attr_list[] = { static struct device_attribute *sysfs_device_attr_list[] = {
&dev_attr_max_sectors, NULL, &dev_attr_max_sectors, NULL,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment