summaryrefslogtreecommitdiff
path: root/drivers/usb/input
diff options
context:
space:
mode:
authorAdam Kropelin <akropel1@rochester.rr.com>2005-05-29 02:30:08 -0500
committerDmitry Torokhov <dtor_core@ameritech.net>2005-05-29 02:30:08 -0500
commitbef3768d8fdee7e1f1488e7017937eb4bf5797a2 (patch)
treee90fcb529b69af81b0b21a0f3f8c77ecd48ea58d /drivers/usb/input
parent18098a6c750d90e7bdf299fbd2144d05434a8d5a (diff)
Input: HID items of width 32 (bits) or greater are incorrectly extracted
due to a masking bug in hid-core.c:extract(). This patch fixes it up by forcing the mask to be 64 bits wide. Signed-off-by: Adam Kropelin <akropel1@rochester.rr.com> Signed-off-by: Vojtech Pavlik <vojtech@suse.cz> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/usb/input')
-rw-r--r--drivers/usb/input/hid-core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c
index 08e701bc9f64..43215a981814 100644
--- a/drivers/usb/input/hid-core.c
+++ b/drivers/usb/input/hid-core.c
@@ -765,7 +765,7 @@ static __inline__ __u32 s32ton(__s32 value, unsigned n)
static __inline__ __u32 extract(__u8 *report, unsigned offset, unsigned n)
{
report += (offset >> 5) << 2; offset &= 31;
- return (le64_to_cpu(get_unaligned((__le64*)report)) >> offset) & ((1 << n) - 1);
+ return (le64_to_cpu(get_unaligned((__le64*)report)) >> offset) & ((1ULL << n) - 1);
}
static __inline__ void implement(__u8 *report, unsigned offset, unsigned n, __u32 value)