um: vector: Use %pM format specifier for MAC addresses
PATCH 1/1 um: vector: Use %pM format specifier for MAC addresses
Convert to %pM instead of using custom code.
Signed-off-by Andy Shevchenko <[email protected]>
--- arch/um/drivers/vector_kern.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
arch/um/drivers/vector_kern.c +6 -3
@@ -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:
Signature · 1 line
2.50.1
Quoted 1 line · Andy Shevchenko
Convert to %pM instead of using custom code.
Any comments on this?
Signature · 2 lines
With Best Regards, Andy Shevchenko