Skip to contentSkip to conversation

scsi-sysfs bug fix

PATCH Douglas Gilbert 1 participant 1 message Mar 19, 2003

lore
Share & tools
lore
#0 lore raw
Quoted 4 lines · Robert Love

drivers/scsi/scsi_sysfs.c :: store_rescan_field() calls scsi_rescan_device() without a prototype, and thus results in a compiler warning.

Quoted 8 lines

Fix that up by adding the prototype to scsi.h, where it belongs.

But then we see we are storing the return value of a void function (so that is why ANSI C is good)... so fix that up, too, by setting the return value to zero if a valid device was found. Otherwise, return ENODEV as before.

Patch is against 2.5.65.

Christoph Hellwig sent a patch for this to the linux-scsi list. Both patches have the same minor problem. Sysfs store() callbacks are supposed to return the count of bytes consumed. It's a moot point in this case since there is no sscanf() processing. To use this code I can get to the appropriate sysfs directory and write:

  # echo "anything_I_like" > rescan

So are all bytes in that string consumed? If so the "ret = 0;" line in your patch should be "ret = count;".

Doug Gilbert