Skip to contentSkip to conversation

HID: cypress: Use swap macro

PATCH New Axel Lin 1 participant 1 message Sep 17, 2012 HID

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 HID: cypress: Use swap macro

This simplify the implementation.

---
 drivers/hid/hid-cypress.c |    6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/hid/hid-cypress.c +1 -5
index 3e159a5..3b795a2 100644
@@ -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;
 }
Signature · 1 line
1.7.9.5