* [PATCH v1 1/1] um: vector: Use %pM format specifier for MAC addresses
@ 2026-06-03 7:29 Andy Shevchenko
0 siblings, 0 replies; only message in thread
From: Andy Shevchenko @ 2026-06-03 7:29 UTC (permalink / raw)
To: linux-um, linux-kernel
Cc: Richard Weinberger, Anton Ivanov, Johannes Berg, Andy Shevchenko
Convert to %pM instead of using custom code.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
arch/um/drivers/vector_kern.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/arch/um/drivers/vector_kern.c b/arch/um/drivers/vector_kern.c
index 2cc90055499a..e09c9db4f4a7 100644
--- a/arch/um/drivers/vector_kern.c
+++ b/arch/um/drivers/vector_kern.c
@@ -1557,13 +1557,16 @@ static void vector_setup_etheraddr(struct net_device *dev, char *str)
"Attempt to assign an invalid ethernet address to a device disallowed\n");
goto random;
}
+
+ eth_hw_addr_set(dev, addr);
+
if (!is_local_ether_addr(addr)) {
+ addr[0] |= 0x02;
netdev_warn(dev, "Warning: Assigning a globally valid ethernet address to a device\n");
netdev_warn(dev, "You should set the 2nd rightmost bit in the first byte of the MAC,\n");
- netdev_warn(dev, "i.e. %02x:%02x:%02x:%02x:%02x:%02x\n",
- addr[0] | 0x02, addr[1], addr[2], addr[3], addr[4], addr[5]);
+ netdev_warn(dev, "i.e. %pM\n", addr);
}
- eth_hw_addr_set(dev, addr);
+
return;
random:
--
2.50.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-06-03 7:30 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-03 7:29 [PATCH v1 1/1] um: vector: Use %pM format specifier for MAC addresses Andy Shevchenko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome