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:
Fabian Frederick 2015-06-10 18:32:05 +02:00 committed by Jiri Kosina
parent 18eec2cd7e
commit 74a3e0c719

View file

@ -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;
}