Skip to content

Commit 6f0168d

Browse files
hharrisonJiri Kosina
authored andcommitted
HID: use get/put_unaligned_* helpers
Signed-off-by: Harvey Harrison <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 9063974 commit 6f0168d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/hid/hid-core.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,7 @@ static __inline__ __u32 extract(__u8 *report, unsigned offset, unsigned n)
780780
*/
781781
static __inline__ void implement(__u8 *report, unsigned offset, unsigned n, __u32 value)
782782
{
783-
__le64 x;
783+
u64 x;
784784
u64 m = (1ULL << n) - 1;
785785

786786
if (n > 32)
@@ -796,10 +796,10 @@ static __inline__ void implement(__u8 *report, unsigned offset, unsigned n, __u3
796796
report += offset >> 3;
797797
offset &= 7;
798798

799-
x = get_unaligned((__le64 *)report);
800-
x &= cpu_to_le64(~(m << offset));
801-
x |= cpu_to_le64(((u64) value) << offset);
802-
put_unaligned(x, (__le64 *) report);
799+
x = get_unaligned_le64(report);
800+
x &= ~(m << offset);
801+
x |= ((u64)value) << offset;
802+
put_unaligned_le64(x, report);
803803
}
804804

805805
/*

0 commit comments

Comments
 (0)