lkml.org 
[lkml]   [2003]   [Mar]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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/

\
 
 \ /
  Last update: 2005-03-22 13:34    [W:0.022 / U:0.588 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site