Skip to content

Commit

Permalink
HID: cypress: use swap() in cp_report_fixup()
Browse files Browse the repository at this point in the history
Use kernel.h macro definition.

Thanks to Julia Lawall for Coccinelle scripting support.

Signed-off-by: Fabian Frederick <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>
  • Loading branch information
Fabian Frederick authored and Jiri Kosina committed Jun 18, 2015
1 parent 18eec2c commit 74a3e0c
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions drivers/hid/hid-cypress.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 74a3e0c

Please sign in to comment.