aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
authorHarvey Harrison <harvey.harrison@gmail.com>2008-04-29 04:03:31 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-29 11:06:27 -0400
commitc105068f2b35343eecf2bf16ee29a362b6121fa3 (patch)
treef8561ca8579ee38f7722deae1f47efa5bfe7b52f /drivers/hid
parentf885f8d127665e784a8071755243bd4e18f594d5 (diff)
hid-core: use get_unaligned_* helpers
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Acked-by: Jiri Kosina <jkosina@suse.cz> Cc: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/hid-core.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index e03c67dd3e63..f43d6d3cf2fa 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -606,7 +606,7 @@ static u8 *fetch_item(__u8 *start, __u8 *end, struct hid_item *item)
606 case 2: 606 case 2:
607 if ((end - start) < 2) 607 if ((end - start) < 2)
608 return NULL; 608 return NULL;
609 item->data.u16 = le16_to_cpu(get_unaligned((__le16*)start)); 609 item->data.u16 = get_unaligned_le16(start);
610 start = (__u8 *)((__le16 *)start + 1); 610 start = (__u8 *)((__le16 *)start + 1);
611 return start; 611 return start;
612 612
@@ -614,7 +614,7 @@ static u8 *fetch_item(__u8 *start, __u8 *end, struct hid_item *item)
614 item->size++; 614 item->size++;
615 if ((end - start) < 4) 615 if ((end - start) < 4)
616 return NULL; 616 return NULL;
617 item->data.u32 = le32_to_cpu(get_unaligned((__le32*)start)); 617 item->data.u32 = get_unaligned_le32(start);
618 start = (__u8 *)((__le32 *)start + 1); 618 start = (__u8 *)((__le32 *)start + 1);
619 return start; 619 return start;
620 } 620 }
@@ -765,7 +765,7 @@ static __inline__ __u32 extract(__u8 *report, unsigned offset, unsigned n)
765 765
766 report += offset >> 3; /* adjust byte index */ 766 report += offset >> 3; /* adjust byte index */
767 offset &= 7; /* now only need bit offset into one byte */ 767 offset &= 7; /* now only need bit offset into one byte */
768 x = le64_to_cpu(get_unaligned((__le64 *) report)); 768 x = get_unaligned_le64(report);
769 x = (x >> offset) & ((1ULL << n) - 1); /* extract bit field */ 769 x = (x >> offset) & ((1ULL << n) - 1); /* extract bit field */
770 return (u32) x; 770 return (u32) x;
771} 771}