HID: sony: Print reversed MAC address via %pMR
PATCH 1/1 HID: sony: Print reversed MAC address via %pMR
Reversed MAC addresses can be printed directly using %pMR specifier.
--- drivers/hid/hid-sony.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-)
drivers/hid/hid-sony.c +2 -8
@@ -2399,10 +2399,7 @@ static int sony_check_add(struct sony_sc *sc)memcpy (sc->mac_address, &buf[1 ],sizeof (sc->mac_address));snprintf (sc->hdev->uniq,sizeof (sc->hdev->uniq), -"%02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx" , - sc->mac_address[5 ], sc->mac_address[4 ], - sc->mac_address[3 ], sc->mac_address[2 ], - sc->mac_address[1 ], sc->mac_address[0 ]); +"%pMR" , sc->mac_address); }else if ((sc->quirks &SIXAXIS_CONTROLLER_USB ) || (sc->quirks &NAVIGATION_CONTROLLER_USB )) { buf =kmalloc (SIXAXIS_REPORT_0xF2_SIZE,GFP_KERNEL );
@@ -2432,10 +2429,7 @@ static int sony_check_add(struct sony_sc *sc) sc->mac_address[5 -n] = buf[4 +n];snprintf (sc->hdev->uniq,sizeof (sc->hdev->uniq), -"%02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx" , - sc->mac_address[5 ], sc->mac_address[4 ], - sc->mac_address[3 ], sc->mac_address[2 ], - sc->mac_address[1 ], sc->mac_address[0 ]); +"%pMR" , sc->mac_address); }else {return 0 ; }
Signature · 1 line
2.15.0
Quoted 26 lines · Andy Shevchenko
Reversed MAC addresses can be printed directly using %pMR specifier.
Signed-off-by Andy Shevchenko <[email protected]>--- drivers/hid/hid-sony.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-)drivers/hid/hid-sony.c +1
-4@@ -2399,10 +2399,7 @@ static int sony_check_add(struct sony_sc *sc)memcpy (sc->mac_address, &buf[1 ],sizeof (sc->mac_address));snprintf (sc->hdev->uniq,sizeof (sc->hdev->uniq), -"%02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx" , - sc->mac_address[5 ], sc->mac_address[4 ], - sc->mac_address[3 ], sc->mac_address[2 ], - sc->mac_address[1 ], sc->mac_address[0 ]); +"%pMR" , sc->mac_address); }else if ((sc->quirks &SIXAXIS_CONTROLLER_USB ) || (sc->quirks &NAVIGATION_CONTROLLER_USB )) { buf =kmalloc (SIXAXIS_REPORT_0xF2_SIZE,GFP_KERNEL );@@ -2432,10 +2429,7 @@ static int sony_check_add(struct sony_sc *sc) sc->mac_address[5 -n] = buf[4 +n];
drivers/hid/hid-sony.c static int sony_check_add(struct sony_sc *sc) · line 2435
Quoted 10 lines
drivers/hid/hid-sony.c +1
-4snprintf (sc->hdev->uniq,sizeof (sc->hdev->uniq), -"%02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx" , - sc->mac_address[5 ], sc->mac_address[4 ], - sc->mac_address[3 ], sc->mac_address[2 ], - sc->mac_address[1 ], sc->mac_address[0 ]); +"%pMR" , sc->mac_address); }else {return 0 ; }
Looks good and in a quick test seems to function.
Quoted 7 lines · Roelof
Quoted 1 line · Andy Shevchenko
Reversed MAC addresses can be printed directly using %pMR specifier.
Looks good and in a quick test seems to function.
Benjamin, perhaps it's good enough to being applied?
Signature · 2 lines
Andy Shevchenko <[email protected]> Intel Finland Oy
Benjamin Tissoires
Acked-byHi Andy,
Quoted 10 lines · Andy Shevchenko
Quoted 7 lines · Roelof
Quoted 1 line · Andy Shevchenko
Reversed MAC addresses can be printed directly using %pMR specifier.
Looks good and in a quick test seems to function.
Benjamin, perhaps it's good enough to being applied?
This question should be directed to Jiri :)
Anyway:
Cheers,
Benjamin
Quoted 8 lines · Benjamin Tissoires
Hi Andy,
Quoted 4 lines · Andy Shevchenko
Quoted 3 lines · Roelof
Quoted 2 lines · Andy Shevchenko
Reversed MAC addresses can be printed directly using %pMR specifier.
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Looks good and in a quick test seems to function.
Benjamin, perhaps it's good enough to being applied?
This question should be directed to Jiri :)
Jiri?
Quoted 2 lines
Anyway:
Thanks!
Signature · 2 lines
Andy Shevchenko <[email protected]> Intel Finland Oy
Quoted 3 lines · Andy Shevchenko
Reversed MAC addresses can be printed directly using %pMR specifier.
Signed-off-by Andy Shevchenko <[email protected]>
Applied, thanks (and sorry for the delay caused by spectral meltdown).
Signature · 2 lines
Jiri Kosina SUSE Labs