Messages in this thread | ![/](/images/icornerl.gif) | | Date | Thu, 20 Mar 2003 09:56:19 +1000 | From | Douglas Gilbert <> | Subject | Re: [patch] scsi-sysfs bug fix |
| |
Robert Love wrote: > drivers/scsi/scsi_sysfs.c :: store_rescan_field() calls > scsi_rescan_device() without a prototype, and thus results > in a compiler warning. > > 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
- 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/
| ![\](/images/icornerr.gif) |