Skip to content

Commit 7c510e4

Browse files
jmbergdavem330
authored andcommitted
net: convert more to %pM
A number of places still use %02x:...:%02x because it's in debug statements or for no real reason. Make a few of them use %pM. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent e174961 commit 7c510e4

26 files changed

Lines changed: 50 additions & 141 deletions

File tree

‎arch/sparc64/kernel/idprom.c‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,5 @@ void __init idprom_init(void)
4242
idprom->id_cksum, calc_idprom_cksum(idprom));
4343
}
4444

45-
printk("Ethernet address: %02x:%02x:%02x:%02x:%02x:%02x\n",
46-
idprom->id_ethaddr[0], idprom->id_ethaddr[1],
47-
idprom->id_ethaddr[2], idprom->id_ethaddr[3],
48-
idprom->id_ethaddr[4], idprom->id_ethaddr[5]);
45+
printk("Ethernet address: %pM\n", idprom->id_ethaddr);
4946
}

‎arch/um/drivers/net_kern.c‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -418,12 +418,7 @@ static void eth_configure(int n, void *init, char *mac,
418418

419419
setup_etheraddr(mac, device->mac, dev->name);
420420

421-
printk(KERN_INFO "Netdevice %d ", n);
422-
printk("(%02x:%02x:%02x:%02x:%02x:%02x) ",
423-
device->mac[0], device->mac[1],
424-
device->mac[2], device->mac[3],
425-
device->mac[4], device->mac[5]);
426-
printk(": ");
421+
printk(KERN_INFO "Netdevice %d (%pM) : ", n, device->mac);
427422

428423
lp = dev->priv;
429424
/* This points to the transport private data. It's still clear, but we

‎arch/xtensa/platforms/iss/network.c‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -660,10 +660,7 @@ static int iss_net_configure(int index, char *init)
660660

661661
printk(KERN_INFO "Netdevice %d ", index);
662662
if (lp->have_mac)
663-
printk("(%02x:%02x:%02x:%02x:%02x:%02x) ",
664-
lp->mac[0], lp->mac[1],
665-
lp->mac[2], lp->mac[3],
666-
lp->mac[4], lp->mac[5]);
663+
printk("(%pM) ", lp->mac);
667664
printk(": ");
668665

669666
/* sysfs register */

‎drivers/media/dvb/b2c2/flexcop.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ int flexcop_device_initialize(struct flexcop_device *fc)
270270
/* do the MAC address reading after initializing the dvb_adapter */
271271
if (fc->get_mac_addr(fc, 0) == 0) {
272272
u8 *b = fc->dvb_adapter.proposed_mac;
273-
info("MAC address = %02x:%02x:%02x:%02x:%02x:%02x", b[0],b[1],b[2],b[3],b[4],b[5]);
273+
info("MAC address = %pM", b);
274274
flexcop_set_mac_filter(fc,b);
275275
flexcop_mac_filter_ctrl(fc,1);
276276
} else

‎drivers/media/dvb/bt8xx/dst.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -917,9 +917,7 @@ static int dst_get_mac(struct dst_state *state)
917917
}
918918
memset(&state->mac_address, '\0', 8);
919919
memcpy(&state->mac_address, &state->rxbuffer, 6);
920-
dprintk(verbose, DST_ERROR, 1, "MAC Address=[%02x:%02x:%02x:%02x:%02x:%02x]",
921-
state->mac_address[0], state->mac_address[1], state->mac_address[2],
922-
state->mac_address[4], state->mac_address[5], state->mac_address[6]);
920+
dprintk(verbose, DST_ERROR, 1, "MAC Address=[%pM]", state->mac_address);
923921

924922
return 0;
925923
}

‎drivers/media/dvb/dm1105/dm1105.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -697,8 +697,7 @@ static void __devinit dm1105dvb_read_mac(struct dm1105dvb *dm1105dvb, u8 *mac)
697697
};
698698

699699
dm1105_i2c_xfer(&dm1105dvb->i2c_adap, msg , 2);
700-
dev_info(&dm1105dvb->pdev->dev, "MAC %02x:%02x:%02x:%02x:%02x:%02x\n",
701-
mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
700+
dev_info(&dm1105dvb->pdev->dev, "MAC %pM\n", mac);
702701
}
703702

704703
static int __devinit dm1105_probe(struct pci_dev *pdev,

‎drivers/media/dvb/dvb-usb/dvb-usb-dvb.c‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,7 @@ int dvb_usb_adapter_dvb_init(struct dvb_usb_adapter *adap, short *adapter_nums)
9191

9292
if (adap->dev->props.read_mac_address) {
9393
if (adap->dev->props.read_mac_address(adap->dev,adap->dvb_adap.proposed_mac) == 0)
94-
info("MAC address: %02x:%02x:%02x:%02x:%02x:%02x",adap->dvb_adap.proposed_mac[0],
95-
adap->dvb_adap.proposed_mac[1], adap->dvb_adap.proposed_mac[2],
96-
adap->dvb_adap.proposed_mac[3], adap->dvb_adap.proposed_mac[4],
97-
adap->dvb_adap.proposed_mac[5]);
94+
info("MAC address: %pM",adap->dvb_adap.proposed_mac);
9895
else
9996
err("MAC address reading failed.");
10097
}

‎drivers/media/dvb/pluto2/pluto2.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -560,8 +560,7 @@ static void __devinit pluto_read_mac(struct pluto *pluto, u8 *mac)
560560
mac[4] = (val >> 8) & 0xff;
561561
mac[5] = (val >> 0) & 0xff;
562562

563-
dev_info(&pluto->pdev->dev, "MAC %02x:%02x:%02x:%02x:%02x:%02x\n",
564-
mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
563+
dev_info(&pluto->pdev->dev, "MAC %pM\n", mac);
565564
}
566565

567566
static int __devinit pluto_read_serial(struct pluto *pluto)

‎drivers/message/fusion/mptlan.c‎

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1462,11 +1462,9 @@ mptlan_probe(struct pci_dev *pdev, const struct pci_device_id *id)
14621462
printk(KERN_INFO MYNAM ": %s: Fusion MPT LAN device "
14631463
"registered as '%s'\n", ioc->name, dev->name);
14641464
printk(KERN_INFO MYNAM ": %s/%s: "
1465-
"LanAddr = %02X:%02X:%02X:%02X:%02X:%02X\n",
1465+
"LanAddr = %pM\n",
14661466
IOC_AND_NETDEV_NAMES_s_s(dev),
1467-
dev->dev_addr[0], dev->dev_addr[1],
1468-
dev->dev_addr[2], dev->dev_addr[3],
1469-
dev->dev_addr[4], dev->dev_addr[5]);
1467+
dev->dev_addr);
14701468

14711469
ioc->netdev = dev;
14721470

@@ -1551,9 +1549,8 @@ mpt_lan_type_trans(struct sk_buff *skb, struct net_device *dev)
15511549

15521550
printk (KERN_WARNING MYNAM ": %s: WARNING - Broadcast swap F/W bug detected!\n",
15531551
NETDEV_PTR_TO_IOC_NAME_s(dev));
1554-
printk (KERN_WARNING MYNAM ": Please update sender @ MAC_addr = %02x:%02x:%02x:%02x:%02x:%02x\n",
1555-
fch->saddr[0], fch->saddr[1], fch->saddr[2],
1556-
fch->saddr[3], fch->saddr[4], fch->saddr[5]);
1552+
printk (KERN_WARNING MYNAM ": Please update sender @ MAC_addr = %pM\n",
1553+
fch->saddr);
15571554
}
15581555

15591556
if (*fch->daddr & 1) {
@@ -1628,10 +1625,9 @@ mpt_lan_type_trans(struct sk_buff *skb, struct net_device *dev)
16281625
nh->NAA = source_naa; /* Set the S_NAA value. */
16291626
for (i = 0; i < FC_ALEN; i++)
16301627
nh->ieee[i] = fch->saddr[i];
1631-
dlprintk ((KERN_INFO "Got ARP from %02x:%02x:%02x:%02x:"
1632-
"%02x:%02x with non-compliant S_NAA value.\n",
1633-
fch->saddr[0], fch->saddr[1], fch->saddr[2],
1634-
fch->saddr[3], fch->saddr[4],fch->saddr[5]));
1628+
dlprintk ((KERN_INFO "Got ARP from %pM with"
1629+
" non-compliant S_NAA value.\n",
1630+
fch->saddr));
16351631
} else {
16361632
printk (KERN_ERR "mptlan/type_trans: Unable to"
16371633
" kmalloc a NAA_Hosed struct.\n");

‎drivers/net/bnx2x_main.c‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9851,11 +9851,8 @@ static void bnx2x_set_rx_mode(struct net_device *dev)
98519851
mclist && (i < dev->mc_count);
98529852
i++, mclist = mclist->next) {
98539853

9854-
DP(NETIF_MSG_IFUP, "Adding mcast MAC: "
9855-
"%02x:%02x:%02x:%02x:%02x:%02x\n",
9856-
mclist->dmi_addr[0], mclist->dmi_addr[1],
9857-
mclist->dmi_addr[2], mclist->dmi_addr[3],
9858-
mclist->dmi_addr[4], mclist->dmi_addr[5]);
9854+
DP(NETIF_MSG_IFUP, "Adding mcast MAC: %pM\n",
9855+
mclist->dmi_addr);
98599856

98609857
crc = crc32c_le(0, mclist->dmi_addr, ETH_ALEN);
98619858
bit = (crc >> 24) & 0xff;

0 commit comments

Comments
 (0)