diff options
author | Fabian Frederick <fabf@skynet.be> | 2015-06-10 19:32:05 +0300 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2015-06-18 12:00:42 +0300 |
commit | 74a3e0c719dcfc66333f43a8414a9c5bfc50bf95 (patch) | |
tree | ffbee832725f1604367c806bbbdb37ae26337a1d /drivers/hid | |
parent | 18eec2cd7e9746cd672ada102987534ae16f0f44 (diff) | |
download | linux-74a3e0c719dcfc66333f43a8414a9c5bfc50bf95.tar.xz |
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')
-rw-r--r-- | drivers/hid/hid-cypress.c | 6 |
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; } |