[PATCH][RFC] fixup store_rescan_field / scsi_rescan_device

From: Martin J. Bligh (mbligh@aracnet.com)
Date: Thu Mar 20 2003 - 03:12:25 EST


OK, started off with this warning:

drivers/scsi/scsi_sysfs.c: In function `store_rescan_field':
drivers/scsi/scsi_sysfs.c:282: warning: implicit declaration of function `scsi_rescan_device

which is easy to fix by just adding a declaration in the header, but
store_rescan_field is expecting a return value from a void func (oops).
I made it assume 0, which *seems* reasonable giving the surrounding
code, but I'm not really familiar with this area, so would like
someone's blessing?

M.

diff -urpN -X /home/fletch/.diff.exclude virgin/drivers/scsi/scsi.h scsi_sysfs_fix/drivers/scsi/scsi.h
--- virgin/drivers/scsi/scsi.h Mon Mar 17 21:43:46 2003
+++ scsi_sysfs_fix/drivers/scsi/scsi.h Wed Mar 19 23:54:50 2003
@@ -442,6 +442,7 @@ extern void scsi_finish_command(Scsi_Cmn
 extern int scsi_retry_command(Scsi_Cmnd *);
 extern int scsi_attach_device(struct scsi_device *);
 extern void scsi_detach_device(struct scsi_device *);
+extern void scsi_rescan_device(struct scsi_device *);
 extern int scsi_get_device_flags(unsigned char *vendor, unsigned char *model);
 
 /*
diff -urpN -X /home/fletch/.diff.exclude virgin/drivers/scsi/scsi_sysfs.c scsi_sysfs_fix/drivers/scsi/scsi_sysfs.c
--- virgin/drivers/scsi/scsi_sysfs.c Mon Mar 17 21:43:46 2003
+++ scsi_sysfs_fix/drivers/scsi/scsi_sysfs.c Thu Mar 20 00:01:13 2003
@@ -275,12 +275,13 @@ show_rescan_field (struct device *dev, c
 static ssize_t
 store_rescan_field (struct device *dev, const char *buf, size_t count)
 {
- int ret = ENODEV;
         struct scsi_device *sdev;
         sdev = to_scsi_device(dev);
- if (sdev)
- ret = scsi_rescan_device(sdev);
- return ret;
+ if (sdev) {
+ scsi_rescan_device(sdev);
+ return 0;
+ } else
+ return ENODEV;
 }
 
 static DEVICE_ATTR(rescan, S_IRUGO | S_IWUSR, show_rescan_field, store_rescan_field)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Mar 23 2003 - 22:00:30 EST