Re: [PATCH v2 2/2] HID: nintendo: Use %pM format specifier for MAC addresses

From: Benjamin Tissoires

Date: Wed Jun 03 2026 - 08:16:56 EST


On Jun 03 2026, Andy Shevchenko wrote:
> Convert to %pM instead of using custom code.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>

Not sure where the first patch should land, so in case someone prefers
having the full series through their tree:
Acked-by: Benjamin Tissoires <bentiss@xxxxxxxxxx>

Cheers,
Benjamin

> ---
> drivers/hid/hid-nintendo.c | 10 ++--------
> 1 file changed, 2 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/hid/hid-nintendo.c b/drivers/hid/hid-nintendo.c
> index 29008c2cc530..05c50f2530ef 100644
> --- a/drivers/hid/hid-nintendo.c
> +++ b/drivers/hid/hid-nintendo.c
> @@ -2431,14 +2431,8 @@ static int joycon_read_info(struct joycon_ctlr *ctlr)
> for (i = 4, j = 0; j < 6; i++, j++)
> ctlr->mac_addr[j] = report->subcmd_reply.data[i];
>
> - ctlr->mac_addr_str = devm_kasprintf(&ctlr->hdev->dev, GFP_KERNEL,
> - "%02X:%02X:%02X:%02X:%02X:%02X",
> - ctlr->mac_addr[0],
> - ctlr->mac_addr[1],
> - ctlr->mac_addr[2],
> - ctlr->mac_addr[3],
> - ctlr->mac_addr[4],
> - ctlr->mac_addr[5]);
> + ctlr->mac_addr_str = devm_kasprintf(&ctlr->hdev->dev, GFP_KERNEL, "%pMU",
> + ctlr->mac_addr);
> if (!ctlr->mac_addr_str)
> return -ENOMEM;
> hid_info(ctlr->hdev, "controller MAC = %s\n", ctlr->mac_addr_str);
> --
> 2.50.1
>
>