* [PATCH][RFC] fixup store_rescan_field / scsi_rescan_device
@ 2003-03-20 8:12 Martin J. Bligh
0 siblings, 0 replies; only message in thread
From: Martin J. Bligh @ 2003-03-20 8:12 UTC (permalink / raw)
To: linux-kernel; +Cc: andmike, Patrick Mochel, James Bottomley
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)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2003-03-20 8:01 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-20 8:12 [PATCH][RFC] fixup store_rescan_field / scsi_rescan_device Martin J. Bligh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®