mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-24 04:34:08 +08:00
HID: cypress: use swap() in cp_report_fixup()
Use kernel.h macro definition. Thanks to Julia Lawall for Coccinelle scripting support. Signed-off-by: Fabian Frederick <fabf@skynet.be> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
This commit is contained in:
parent
18eec2cd7e
commit
74a3e0c719
@ -41,13 +41,9 @@ static __u8 *cp_report_fixup(struct hid_device *hdev, __u8 *rdesc,
|
||||
|
||||
for (i = 0; i < *rsize - 4; i++)
|
||||
if (rdesc[i] == 0x29 && rdesc[i + 2] == 0x19) {
|
||||
__u8 tmp;
|
||||
|
||||
rdesc[i] = 0x19;
|
||||
rdesc[i + 2] = 0x29;
|
||||
tmp = rdesc[i + 3];
|
||||
rdesc[i + 3] = rdesc[i + 1];
|
||||
rdesc[i + 1] = tmp;
|
||||
swap(rdesc[i + 3], rdesc[i + 1]);
|
||||
}
|
||||
return rdesc;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user