On Thu, 22 Nov 2007 17:31:39 +0100, Alexe Fisher wrote:
> powertop check if usbcore autosuspen is enabled by checking /sys/bus/usb
> interface. but will make wrong suggestion if one of devices is
> blacklisted or set to NULL ( but NULL if i'm correct mean: suspend now,
>  and only negative option like -1 will disable autosuspend )

Hi,

According to Documentation/ABI/testing/sysfs-bus-usb in Linux, the 
autosuspend files contain a negative number if autosuspend is disabled.  
At the moment, powertop converts the number into an _unsigned_ long long 
int before any comparison, which to me seems like the wrong thing to do.

Have a patch:

Index: usb.c
===================================================================
--- usb.c       (revision 273)
+++ usb.c       (working copy)
@@ -89,7 +89,7 @@
                        fclose(file);
                        continue;
                }
-               if (strtoull(line, NULL,10)<1)
+               if (strtoll(line, NULL,10)<0)
                        need_hint = 1;
 
                fclose(file);

Cheers,

Rob Spanton



_______________________________________________
Power mailing list
[email protected]
http://www.bughost.org/mailman/listinfo/power

Reply via email to