From: sashiko-bot@kernel.org
To: "Andy Shevchenko" <andriy.shevchenko@linux.intel.com>
Cc: linux-input@vger.kernel.org, dmitry.torokhov@gmail.com
Subject: Re: [PATCH v1 1/1] HID: nintendo: Use %pM format specifier for MAC addresses
Date: Wed, 03 Jun 2026 08:39:46 +0000 [thread overview]
Message-ID: <20260603083946.923AD1F00893@smtp.kernel.org> (raw)
In-Reply-To: <20260603082808.119958-1-andriy.shevchenko@linux.intel.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Critical] ABI Breakage: The patch changes the MAC address exposed via sysfs from uppercase to lowercase, breaking userspace tools that rely on exact string matching.
--
commit 6c8c4e53eb547a4381d6f8dabe9201540c4f0168
Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
HID: nintendo: Use %pM format specifier for MAC addresses
This commit refactors the MAC address string generation in the nintendo HID
driver. It replaces a custom sprintf format string with the standard %pM
format specifier.
> diff --git a/drivers/hid/hid-nintendo.c b/drivers/hid/hid-nintendo.c
> index 29008c2cc5304..77b14dfdae867 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, "%pM",
> + ctlr->mac_addr);
[Severity: Critical]
Does this change the sysfs output from uppercase to lowercase?
The original format string %02X explicitly generated an uppercase MAC
address string, while %pM delegates to hex_byte_pack() and generates a
lowercase string.
Since ctlr->mac_addr_str is exposed to userspace via the uniq attribute,
could this cause an ABI regression?
Userspace utilities and gaming libraries (like SDL and the joycond daemon)
often map USB controllers to their Bluetooth pairings by performing
case-sensitive matching against the uppercase Bluetooth MAC addresses
exposed by BlueZ.
> if (!ctlr->mac_addr_str)
> return -ENOMEM;
> hid_info(ctlr->hdev, "controller MAC = %s\n", ctlr->mac_addr_str);
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260603082808.119958-1-andriy.shevchenko@linux.intel.com?part=1
next prev parent reply other threads:[~2026-06-03 8:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-03 8:28 [PATCH v1 1/1] HID: nintendo: Use %pM format specifier for MAC addresses Andy Shevchenko
2026-06-03 8:39 ` sashiko-bot [this message]
2026-06-03 9:05 ` Andy Shevchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260603083946.923AD1F00893@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox