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
1 changed files with 1 additions and 5 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue