Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Harvey Harrison and committed by
Linus Torvalds
c105068f f885f8d1

+3 -3
+3 -3
drivers/hid/hid-core.c
··· 606 606 case 2: 607 607 if ((end - start) < 2) 608 608 return NULL; 609 - item->data.u16 = le16_to_cpu(get_unaligned((__le16*)start)); 609 + item->data.u16 = get_unaligned_le16(start); 610 610 start = (__u8 *)((__le16 *)start + 1); 611 611 return start; 612 612 ··· 614 614 item->size++; 615 615 if ((end - start) < 4) 616 616 return NULL; 617 - item->data.u32 = le32_to_cpu(get_unaligned((__le32*)start)); 617 + item->data.u32 = get_unaligned_le32(start); 618 618 start = (__u8 *)((__le32 *)start + 1); 619 619 return start; 620 620 } ··· 765 765 766 766 report += offset >> 3; /* adjust byte index */ 767 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 769 x = (x >> offset) & ((1ULL << n) - 1); /* extract bit field */ 770 770 return (u32) x; 771 771 }