Skip to content

Commit 648d493

Browse files
andy-shevJiri Kosina
authored andcommitted
HID: sony: Print reversed MAC address via %pMR
Reversed MAC addresses can be printed directly using %pMR specifier. Signed-off-by: Andy Shevchenko <[email protected]> Acked-by: Roderick Colenbrander <[email protected]> Acked-by: Benjamin Tissoires <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent efdd17f commit 648d493

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

drivers/hid/hid-sony.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2399,10 +2399,7 @@ static int sony_check_add(struct sony_sc *sc)
23992399
memcpy(sc->mac_address, &buf[1], sizeof(sc->mac_address));
24002400

24012401
snprintf(sc->hdev->uniq, sizeof(sc->hdev->uniq),
2402-
"%02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx",
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]);
2402+
"%pMR", sc->mac_address);
24062403
} else if ((sc->quirks & SIXAXIS_CONTROLLER_USB) ||
24072404
(sc->quirks & NAVIGATION_CONTROLLER_USB)) {
24082405
buf = kmalloc(SIXAXIS_REPORT_0xF2_SIZE, GFP_KERNEL);
@@ -2432,10 +2429,7 @@ static int sony_check_add(struct sony_sc *sc)
24322429
sc->mac_address[5-n] = buf[4+n];
24332430

24342431
snprintf(sc->hdev->uniq, sizeof(sc->hdev->uniq),
2435-
"%02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx",
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]);
2432+
"%pMR", sc->mac_address);
24392433
} else {
24402434
return 0;
24412435
}

0 commit comments

Comments
 (0)