Linux Input/HID development
 help / color / mirror / Atom feed
* [PATCH] HID: cypress: Use swap macro
@ 2012-09-17 13:35 Axel Lin
  0 siblings, 0 replies; only message in thread
From: Axel Lin @ 2012-09-17 13:35 UTC (permalink / raw)
  To: Jiri Kosina; +Cc: Jiri Slaby, linux-input

This simplify the implementation.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 drivers/hid/hid-cypress.c |    6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/hid/hid-cypress.c b/drivers/hid/hid-cypress.c
index 3e159a5..3b795a2 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 + 1], rdesc[i + 3]);
 		}
 	return rdesc;
 }
-- 
1.7.9.5




^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-09-17 13:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-17 13:35 [PATCH] HID: cypress: Use swap macro Axel Lin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox