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

USB storage: audit sysfs attribute permissions

Convert the usbsorage sysfs attribute to use the _RW macro to make it
easier to determine the permissions for the file.
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 62f4b242
...@@ -496,7 +496,7 @@ US_DO_ALL_FLAGS ...@@ -496,7 +496,7 @@ US_DO_ALL_FLAGS
***********************************************************************/ ***********************************************************************/
/* Output routine for the sysfs max_sectors file */ /* Output routine for the sysfs max_sectors file */
static ssize_t show_max_sectors(struct device *dev, struct device_attribute *attr, char *buf) static ssize_t max_sectors_show(struct device *dev, struct device_attribute *attr, char *buf)
{ {
struct scsi_device *sdev = to_scsi_device(dev); struct scsi_device *sdev = to_scsi_device(dev);
...@@ -504,7 +504,7 @@ static ssize_t show_max_sectors(struct device *dev, struct device_attribute *att ...@@ -504,7 +504,7 @@ static ssize_t show_max_sectors(struct device *dev, struct device_attribute *att
} }
/* Input routine for the sysfs max_sectors file */ /* Input routine for the sysfs max_sectors file */
static ssize_t store_max_sectors(struct device *dev, struct device_attribute *attr, const char *buf, static ssize_t max_sectors_store(struct device *dev, struct device_attribute *attr, const char *buf,
size_t count) size_t count)
{ {
struct scsi_device *sdev = to_scsi_device(dev); struct scsi_device *sdev = to_scsi_device(dev);
...@@ -514,16 +514,14 @@ static ssize_t store_max_sectors(struct device *dev, struct device_attribute *at ...@@ -514,16 +514,14 @@ static ssize_t store_max_sectors(struct device *dev, struct device_attribute *at
blk_queue_max_hw_sectors(sdev->request_queue, ms); blk_queue_max_hw_sectors(sdev->request_queue, ms);
return count; return count;
} }
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, &dev_attr_max_sectors,
NULL, NULL,
}; };
/* /*
* this defines our host template, with which we'll allocate hosts * this defines our host template, with which we'll allocate hosts
......
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