Commit 6f0168d2 authored by Harvey Harrison's avatar Harvey Harrison Committed by Jiri Kosina

HID: use get/put_unaligned_* helpers

Signed-off-by: default avatarHarvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 9063974c
...@@ -780,7 +780,7 @@ static __inline__ __u32 extract(__u8 *report, unsigned offset, unsigned n) ...@@ -780,7 +780,7 @@ static __inline__ __u32 extract(__u8 *report, unsigned offset, unsigned n)
*/ */
static __inline__ void implement(__u8 *report, unsigned offset, unsigned n, __u32 value) static __inline__ void implement(__u8 *report, unsigned offset, unsigned n, __u32 value)
{ {
__le64 x; u64 x;
u64 m = (1ULL << n) - 1; u64 m = (1ULL << n) - 1;
if (n > 32) if (n > 32)
...@@ -796,10 +796,10 @@ static __inline__ void implement(__u8 *report, unsigned offset, unsigned n, __u3 ...@@ -796,10 +796,10 @@ static __inline__ void implement(__u8 *report, unsigned offset, unsigned n, __u3
report += offset >> 3; report += offset >> 3;
offset &= 7; offset &= 7;
x = get_unaligned((__le64 *)report); x = get_unaligned_le64(report);
x &= cpu_to_le64(~(m << offset)); x &= ~(m << offset);
x |= cpu_to_le64(((u64) value) << offset); x |= ((u64)value) << offset;
put_unaligned(x, (__le64 *) report); put_unaligned_le64(x, report);
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment