lkml.org 
[lkml]   [2009]   [Dec]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH 2/2] Fix a bug on appledisplay.c regarding signedness
On Tue, Dec 22, 2009 at 11:29:37AM -0800, Greg KH wrote:
[...]
> Care to resend this one with the proper changelog comment so that I can
> apply it?
>
Sure. Here it goes... Please let me know if more editing is required.



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>
---
drivers/usb/misc/appledisplay.c | 4 +-
1 file changed, 2 insertions(+), 2 deletions(-)
diff -purN a/drivers/usb/misc/appledisplay.c b/drivers/usb/misc/appledisplay.c
--- a/drivers/usb/misc/appledisplay.c 2009-11-10 01:32:31.000000000 +0100
+++ b/drivers/usb/misc/appledisplay.c 2009-12-02 20:05:00.000000000 +0100
@@ -72,8 +72,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;


> thanks,
really appreciated. This is my very first (and tiny) contribution to
the linux kernel, even though I've been a user since the 1.2.x series,
back in '96.

> greg k-h

Happy hacking!

pancho.

--
pancho horrillo

To be conscious that
you are ignorant is a great step
to knowledge.

Benjamin Disraeli


\
 
 \ /
  Last update: 2009-12-23 11:11    [from the cache]
©2003-2011 Jasper Spaans