summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYang Guang <yang.guang5@zte.com.cn>2021-11-04 09:14:56 +0800
committerMichael Ellerman <mpe@ellerman.id.au>2022-05-04 19:37:45 +1000
commit6130ed79decc38b873deb582678ac81caefd5555 (patch)
treeac3879db05cfc3e992e26247021890f942e90c72
parent887f56a07f0eee41f60ef3d165facaa348b3e3af (diff)
downloadlinux-6130ed79decc38b873deb582678ac81caefd5555.tar.bz2
macintosh/adb: Use swap() to make code cleaner
Use the macro 'swap()' defined in 'include/linux/minmax.h' to avoid opencoding it. Reported-by: Zeal Robot <zealci@zte.com.cn> Signed-off-by: Yang Guang <yang.guang5@zte.com.cn> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20211104011456.1027830-1-yang.guang5@zte.com.cn
-rw-r--r--drivers/macintosh/adbhid.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/macintosh/adbhid.c b/drivers/macintosh/adbhid.c
index 1d355aa9a1dd..b2fe7a3dc471 100644
--- a/drivers/macintosh/adbhid.c
+++ b/drivers/macintosh/adbhid.c
@@ -816,9 +816,7 @@ adbhid_input_register(int id, int default_id, int original_handler_id,
case 0xC4: case 0xC7:
keyboard_type = "ISO, swapping keys";
input_dev->id.version = ADB_KEYBOARD_ISO;
- i = hid->keycode[10];
- hid->keycode[10] = hid->keycode[50];
- hid->keycode[50] = i;
+ swap(hid->keycode[10], hid->keycode[50]);
break;
case 0x12: case 0x15: case 0x16: case 0x17: case 0x1A: