Skip to contentSkip to conversation

net: dsa: realtek: Use %pM format specifier for MAC addresses

PATCH Applied Andy Shevchenko 5 participants 5 messages Jun 3 – Jun 5

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: dsa: realtek: Use %pM format specifier for MAC addresses

Convert to %pM instead of using custom code.

---
 drivers/net/dsa/realtek/rtl8366rb.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/dsa/realtek/rtl8366rb.c +1 -2
index d96ae72b0a5c..103039fe3086 100644
@@ -573,8 +573,7 @@ static int rtl8366rb_set_addr(struct realtek_priv *priv)
 
 	eth_random_addr(addr);
 
-	dev_info(priv->dev, "set MAC: %02X:%02X:%02X:%02X:%02X:%02X\n",
-		 addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]);
+	dev_info(priv->dev, "set MAC: %pM\n", addr);
 	val = addr[0] << 8 | addr[1];
 	ret = regmap_write(priv->map, RTL8366RB_SMAR0, val);
 	if (ret)
Signature · 1 line
2.50.1
Reviewed-by on v1 1/1
#2 lore raw
In reply to Andy Shevchenko
Quoted 21 lines · Andy Shevchenko

Convert to %pM instead of using custom code.

---
 drivers/net/dsa/realtek/rtl8366rb.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/dsa/realtek/rtl8366rb.c +1 -2
index d96ae72b0a5c..103039fe3086 100644
@@ -573,8 +573,7 @@ static int rtl8366rb_set_addr(struct realtek_priv 
 *priv)
 
 	eth_random_addr(addr);
 
-	dev_info(priv->dev, "set MAC: %02X:%02X:%02X:%02X:%02X:%02X\n",
-		 addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]);
+	dev_info(priv->dev, "set MAC: %pM\n", addr);
 	val = addr[0] << 8 | addr[1];
 	ret = regmap_write(priv->map, RTL8366RB_SMAR0, val);
Quoted 1 line

if (ret)

Thanks
Nicolai

#4 lore raw
In reply to Andy Shevchenko
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 6 lines · On Wed, 3 Jun 2026 13:20:11 +0200 you wrote:

Convert to %pM instead of using custom code.

---
 drivers/net/dsa/realtek/rtl8366rb.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Here is the summary with links:
- [net-next,v1,1/1] net: dsa: realtek: Use %pM format specifier for MAC addresses

    https://git.kernel.org/netdev/net-next/c/c1424df7ff82

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html