]> git.neil.brown.name Git - history.git/commitdiff
USB: Fix a bug on appledisplay.c regarding signedness
authorpancho horrillo <pancho@pancho.name>
Wed, 23 Dec 2009 10:09:13 +0000 (11:09 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 23 Dec 2009 19:34:20 +0000 (11:34 -0800)
brightness status is reported by the Apple Cinema Displays as an
'unsigned char' (u8) value, but the code used 'char' instead.

Note that he driver was developed on the PowerPC architecture,
where the two types are synonymous, which is not always the case.

Fixed that.  Otherwise the driver will interpret brightness
levels > 127 as negative, and fail to load.

Signed-off-by: pancho horrillo <pancho@pancho.name>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/misc/appledisplay.c

index 8dc4afa38b87a4591b0aa84cb9d1b03e7e7e53dd..1eb9e4162cc6a916a3ed8cce7641be7ffb2aa529 100644 (file)
@@ -73,8 +73,8 @@ struct appledisplay {
        struct usb_device *udev;        /* usb device */
        struct urb *urb;                /* usb request block */
        struct backlight_device *bd;    /* backlight device */
-       char *urbdata;                  /* interrupt URB data buffer */
-       char *msgdata;                  /* control message data buffer */
+       u8 *urbdata;                    /* interrupt URB data buffer */
+       u8 *msgdata;                    /* control message data buffer */
 
        struct delayed_work work;
        int button_pressed;