Commit 74a3e0c7 authored by Fabian Frederick's avatar Fabian Frederick Committed by Jiri Kosina

HID: cypress: use swap() in cp_report_fixup()

Use kernel.h macro definition.

Thanks to Julia Lawall for Coccinelle scripting support.
Signed-off-by: default avatarFabian Frederick <fabf@skynet.be>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 18eec2cd
...@@ -41,13 +41,9 @@ static __u8 *cp_report_fixup(struct hid_device *hdev, __u8 *rdesc, ...@@ -41,13 +41,9 @@ static __u8 *cp_report_fixup(struct hid_device *hdev, __u8 *rdesc,
for (i = 0; i < *rsize - 4; i++) for (i = 0; i < *rsize - 4; i++)
if (rdesc[i] == 0x29 && rdesc[i + 2] == 0x19) { if (rdesc[i] == 0x29 && rdesc[i + 2] == 0x19) {
__u8 tmp;
rdesc[i] = 0x19; rdesc[i] = 0x19;
rdesc[i + 2] = 0x29; rdesc[i + 2] = 0x29;
tmp = rdesc[i + 3]; swap(rdesc[i + 3], rdesc[i + 1]);
rdesc[i + 3] = rdesc[i + 1];
rdesc[i + 1] = tmp;
} }
return rdesc; return rdesc;
} }
......
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