summaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-cypress.c
diff options
context:
space:
mode:
authorFabian Frederick <fabf@skynet.be>2015-06-10 18:32:05 +0200
committerJiri Kosina <jkosina@suse.cz>2015-06-18 11:00:42 +0200
commit74a3e0c719dcfc66333f43a8414a9c5bfc50bf95 (patch)
treeffbee832725f1604367c806bbbdb37ae26337a1d /drivers/hid/hid-cypress.c
parentHID: microsoft: Add Surface Power Cover (diff)
downloadlinux-74a3e0c719dcfc66333f43a8414a9c5bfc50bf95.tar.xz
linux-74a3e0c719dcfc66333f43a8414a9c5bfc50bf95.zip
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>
Diffstat (limited to 'drivers/hid/hid-cypress.c')
-rw-r--r--drivers/hid/hid-cypress.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/hid/hid-cypress.c b/drivers/hid/hid-cypress.c
index c4ef3bc726e3..1b764d1745f3 100644
--- a/drivers/hid/hid-cypress.c
+++ b/drivers/hid/hid-cypress.c
@@ -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;
}