Commit 89a07be0 authored by Patrick Mochel's avatar Patrick Mochel

sysfs: fix up SCSI sysfs files.

Remove @count and @off parameters from show() and store() callbacks.
parent 8575d409
...@@ -23,20 +23,16 @@ ...@@ -23,20 +23,16 @@
* Return: * Return:
* number of bytes written into page. * number of bytes written into page.
**/ **/
static ssize_t scsi_host_class_name_show(struct device *dev, char *page, static ssize_t scsi_host_class_name_show(struct device *dev, char *page)
size_t count, loff_t off)
{ {
struct Scsi_Host *shost; struct Scsi_Host *shost;
if (off)
return 0;
shost = to_scsi_host(dev); shost = to_scsi_host(dev);
if (!shost) if (!shost)
return 0; return 0;
return snprintf(page, count, "scsi%d\n", shost->host_no); return snprintf(page, 20, "scsi%d\n", shost->host_no);
} }
DEVICE_ATTR(class_name, S_IRUGO, scsi_host_class_name_show, NULL); DEVICE_ATTR(class_name, S_IRUGO, scsi_host_class_name_show, NULL);
...@@ -138,13 +134,11 @@ void scsi_upper_driver_unregister(struct Scsi_Device_Template *sdev_tp) ...@@ -138,13 +134,11 @@ void scsi_upper_driver_unregister(struct Scsi_Device_Template *sdev_tp)
*/ */
#define show_function(field, format_string) \ #define show_function(field, format_string) \
static ssize_t \ static ssize_t \
show_##field (struct device *dev, char *buf, size_t count, loff_t off) \ show_##field (struct device *dev, char *buf) \
{ \ { \
struct scsi_device *sdev; \ struct scsi_device *sdev; \
if (off) \
return 0; \
sdev = to_scsi_device(dev); \ sdev = to_scsi_device(dev); \
return snprintf (buf, count, format_string, sdev->field); \ return snprintf (buf, 20, format_string, sdev->field); \
} \ } \
/* /*
...@@ -164,14 +158,12 @@ static DEVICE_ATTR(field, S_IRUGO, show_##field, NULL) ...@@ -164,14 +158,12 @@ static DEVICE_ATTR(field, S_IRUGO, show_##field, NULL)
show_function(field, format_string) \ show_function(field, format_string) \
\ \
static ssize_t \ static ssize_t \
store_##field (struct device *dev, const char *buf, size_t count, loff_t off)\ store_##field (struct device *dev, const char *buf) \
{ \ { \
struct scsi_device *sdev; \ struct scsi_device *sdev; \
\
if (off) \
return 0; \
sdev = to_scsi_device(dev); \ sdev = to_scsi_device(dev); \
return snscanf (buf, count, format_string, &sdev->field); \ snscanf (buf, 20, format_string, &sdev->field); \
return strlen(buf); \
} \ } \
static DEVICE_ATTR(field, S_IRUGO | S_IWUSR, show_##field, store_##field) static DEVICE_ATTR(field, S_IRUGO | S_IWUSR, show_##field, store_##field)
...@@ -183,18 +175,15 @@ static DEVICE_ATTR(field, S_IRUGO | S_IWUSR, show_##field, store_##field) ...@@ -183,18 +175,15 @@ static DEVICE_ATTR(field, S_IRUGO | S_IWUSR, show_##field, store_##field)
show_function(field, "%d\n") \ show_function(field, "%d\n") \
\ \
static ssize_t \ static ssize_t \
store_##field (struct device *dev, const char *buf, size_t count, loff_t off)\ store_##field (struct device *dev, const char *buf) \
{ \ { \
int ret; \ int ret; \
struct scsi_device *sdev; \ struct scsi_device *sdev; \
\
if (off) \
return 0; \
ret = scsi_sdev_check_buf_bit(buf); \ ret = scsi_sdev_check_buf_bit(buf); \
if (ret >= 0) { \ if (ret >= 0) { \
sdev = to_scsi_device(dev); \ sdev = to_scsi_device(dev); \
sdev->field = ret; \ sdev->field = ret; \
ret = count; \ ret = strlen(buf); \
} \ } \
return ret; \ return ret; \
} \ } \
......
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