summaryrefslogtreecommitdiffstats
path: root/drivers/staging/keucr
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-08-24 10:33:07 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-08-24 10:33:07 -0700
commit00009615c3fbd49d38771ad07cc9c9d96e05e9cb (patch)
tree66a656b36b5bf291fd0d49a9bb9abefd8f60ee09 /drivers/staging/keucr
parent89dcefb5af9651a4496ed53949ee0e287714f28b (diff)
downloadop-kernel-dev-00009615c3fbd49d38771ad07cc9c9d96e05e9cb.zip
op-kernel-dev-00009615c3fbd49d38771ad07cc9c9d96e05e9cb.tar.gz
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/keucr')
-rw-r--r--drivers/staging/keucr/scsiglue.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/staging/keucr/scsiglue.c b/drivers/staging/keucr/scsiglue.c
index afb00d8..ac3d34d 100644
--- a/drivers/staging/keucr/scsiglue.c
+++ b/drivers/staging/keucr/scsiglue.c
@@ -289,10 +289,7 @@ US_DO_ALL_FLAGS
***********************************************************************/
/* Output routine for the sysfs max_sectors file */
-/*
- * show_max_sectors()
- */
-static ssize_t show_max_sectors(struct device *dev,
+static ssize_t max_sectors_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct scsi_device *sdev = to_scsi_device(dev);
@@ -302,10 +299,7 @@ static ssize_t show_max_sectors(struct device *dev,
}
/* Input routine for the sysfs max_sectors file */
-/*
- * store_max_sectors()
- */
-static ssize_t store_max_sectors(struct device *dev,
+static ssize_t max_sectors_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{
@@ -319,9 +313,8 @@ static ssize_t store_max_sectors(struct device *dev,
}
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[] = {
&dev_attr_max_sectors, NULL,
};
OpenPOWER on IntegriCloud