aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2017-12-11 08:06:12 -0500
committerJiri Kosina <jkosina@suse.cz>2018-01-23 09:37:55 -0500
commit648d49329976edc9d0d73fc0c7a45f15df0b6659 (patch)
tree4660a4693d010385df41bfe334e364d8161d18ad
parentefdd17f89510531a6529e20048670bef9a073466 (diff)
HID: sony: Print reversed MAC address via %pMR
Reversed MAC addresses can be printed directly using %pMR specifier. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Roderick Colenbrander <roderick.colenbranderer@sony.com> Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
-rw-r--r--drivers/hid/hid-sony.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c
index b9dc3ac4d4aa..138fd44d3c91 100644
--- a/drivers/hid/hid-sony.c
+++ b/drivers/hid/hid-sony.c
@@ -2399,10 +2399,7 @@ static int sony_check_add(struct sony_sc *sc)
2399 memcpy(sc->mac_address, &buf[1], sizeof(sc->mac_address)); 2399 memcpy(sc->mac_address, &buf[1], sizeof(sc->mac_address));
2400 2400
2401 snprintf(sc->hdev->uniq, sizeof(sc->hdev->uniq), 2401 snprintf(sc->hdev->uniq, sizeof(sc->hdev->uniq),
2402 "%02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx", 2402 "%pMR", sc->mac_address);
2403 sc->mac_address[5], sc->mac_address[4],
2404 sc->mac_address[3], sc->mac_address[2],
2405 sc->mac_address[1], sc->mac_address[0]);
2406 } else if ((sc->quirks & SIXAXIS_CONTROLLER_USB) || 2403 } else if ((sc->quirks & SIXAXIS_CONTROLLER_USB) ||
2407 (sc->quirks & NAVIGATION_CONTROLLER_USB)) { 2404 (sc->quirks & NAVIGATION_CONTROLLER_USB)) {
2408 buf = kmalloc(SIXAXIS_REPORT_0xF2_SIZE, GFP_KERNEL); 2405 buf = kmalloc(SIXAXIS_REPORT_0xF2_SIZE, GFP_KERNEL);
@@ -2432,10 +2429,7 @@ static int sony_check_add(struct sony_sc *sc)
2432 sc->mac_address[5-n] = buf[4+n]; 2429 sc->mac_address[5-n] = buf[4+n];
2433 2430
2434 snprintf(sc->hdev->uniq, sizeof(sc->hdev->uniq), 2431 snprintf(sc->hdev->uniq, sizeof(sc->hdev->uniq),
2435 "%02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx", 2432 "%pMR", sc->mac_address);
2436 sc->mac_address[5], sc->mac_address[4],
2437 sc->mac_address[3], sc->mac_address[2],
2438 sc->mac_address[1], sc->mac_address[0]);
2439 } else { 2433 } else {
2440 return 0; 2434 return 0;
2441 } 2435 }