Skip to content

Commit

Permalink
net: convert print_mac to %pM
Browse files Browse the repository at this point in the history
This converts pretty much everything to print_mac. There were
a few things that had conflicts which I have just dropped for
now, no harm done.

I've built an allyesconfig with this and looked at the files
that weren't built very carefully, but it's a huge patch.

Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
jmberg authored and davem330 committed Oct 28, 2008
1 parent 0c68ae2 commit e174961
Show file tree
Hide file tree
Showing 235 changed files with 891 additions and 1,571 deletions.
9 changes: 4 additions & 5 deletions arch/arm/mach-ixp4xx/fsg-setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ static irqreturn_t fsg_reset_handler(int irq, void *dev_id)

static void __init fsg_init(void)
{
DECLARE_MAC_BUF(mac_buf);
uint8_t __iomem *f;

ixp4xx_sys_init();
Expand Down Expand Up @@ -256,10 +255,10 @@ static void __init fsg_init(void)
#endif
iounmap(f);
}
printk(KERN_INFO "FSG: Using MAC address %s for port 0\n",
print_mac(mac_buf, fsg_plat_eth[0].hwaddr));
printk(KERN_INFO "FSG: Using MAC address %s for port 1\n",
print_mac(mac_buf, fsg_plat_eth[1].hwaddr));
printk(KERN_INFO "FSG: Using MAC address %pM for port 0\n",
fsg_plat_eth[0].hwaddr);
printk(KERN_INFO "FSG: Using MAC address %pM for port 1\n",
fsg_plat_eth[1].hwaddr);

}

Expand Down
5 changes: 2 additions & 3 deletions arch/arm/mach-ixp4xx/nas100d-setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,6 @@ static irqreturn_t nas100d_reset_handler(int irq, void *dev_id)

static void __init nas100d_init(void)
{
DECLARE_MAC_BUF(mac_buf);
uint8_t __iomem *f;
int i;

Expand Down Expand Up @@ -294,8 +293,8 @@ static void __init nas100d_init(void)
#endif
iounmap(f);
}
printk(KERN_INFO "NAS100D: Using MAC address %s for port 0\n",
print_mac(mac_buf, nas100d_plat_eth[0].hwaddr));
printk(KERN_INFO "NAS100D: Using MAC address %pM for port 0\n",
nas100d_plat_eth[0].hwaddr);

}

Expand Down
5 changes: 2 additions & 3 deletions arch/arm/mach-ixp4xx/nslu2-setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,6 @@ static struct sys_timer nslu2_timer = {

static void __init nslu2_init(void)
{
DECLARE_MAC_BUF(mac_buf);
uint8_t __iomem *f;
int i;

Expand Down Expand Up @@ -275,8 +274,8 @@ static void __init nslu2_init(void)
#endif
iounmap(f);
}
printk(KERN_INFO "NSLU2: Using MAC address %s for port 0\n",
print_mac(mac_buf, nslu2_plat_eth[0].hwaddr));
printk(KERN_INFO "NSLU2: Using MAC address %pM for port 0\n",
nslu2_plat_eth[0].hwaddr);

}

Expand Down
6 changes: 2 additions & 4 deletions drivers/infiniband/hw/nes/nes.c
Original file line number Diff line number Diff line change
Expand Up @@ -356,10 +356,8 @@ struct ib_qp *nes_get_qp(struct ib_device *device, int qpn)
*/
static void nes_print_macaddr(struct net_device *netdev)
{
DECLARE_MAC_BUF(mac);

nes_debug(NES_DBG_INIT, "%s: %s, IRQ %u\n",
netdev->name, print_mac(mac, netdev->dev_addr), netdev->irq);
nes_debug(NES_DBG_INIT, "%s: %pM, IRQ %u\n",
netdev->name, netdev->dev_addr, netdev->irq);
}

/**
Expand Down
10 changes: 4 additions & 6 deletions drivers/infiniband/hw/nes/nes_cm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1027,7 +1027,6 @@ static int nes_addr_resolve_neigh(struct nes_vnic *nesvnic, u32 dst_ip)
struct flowi fl;
struct neighbour *neigh;
int rc = -1;
DECLARE_MAC_BUF(mac);

memset(&fl, 0, sizeof fl);
fl.nl_u.ip4_u.daddr = htonl(dst_ip);
Expand All @@ -1041,8 +1040,8 @@ static int nes_addr_resolve_neigh(struct nes_vnic *nesvnic, u32 dst_ip)
if (neigh) {
if (neigh->nud_state & NUD_VALID) {
nes_debug(NES_DBG_CM, "Neighbor MAC address for 0x%08X"
" is %s, Gateway is 0x%08X \n", dst_ip,
print_mac(mac, neigh->ha), ntohl(rt->rt_gateway));
" is %pM, Gateway is 0x%08X \n", dst_ip,
neigh->ha, ntohl(rt->rt_gateway));
nes_manage_arp_cache(nesvnic->netdev, neigh->ha,
dst_ip, NES_ARP_ADD);
rc = nes_arp_table(nesvnic->nesdev, dst_ip, NULL,
Expand Down Expand Up @@ -1071,7 +1070,6 @@ static struct nes_cm_node *make_cm_node(struct nes_cm_core *cm_core,
int arpindex = 0;
struct nes_device *nesdev;
struct nes_adapter *nesadapter;
DECLARE_MAC_BUF(mac);

/* create an hte and cm_node for this instance */
cm_node = kzalloc(sizeof(*cm_node), GFP_ATOMIC);
Expand Down Expand Up @@ -1137,8 +1135,8 @@ static struct nes_cm_node *make_cm_node(struct nes_cm_core *cm_core,

/* copy the mac addr to node context */
memcpy(cm_node->rem_mac, nesadapter->arp_table[arpindex].mac_addr, ETH_ALEN);
nes_debug(NES_DBG_CM, "Remote mac addr from arp table: %s\n",
print_mac(mac, cm_node->rem_mac));
nes_debug(NES_DBG_CM, "Remote mac addr from arp table: %pM\n",
cm_node->rem_mac);

add_hte_node(cm_core, cm_node);
atomic_inc(&cm_nodes_created);
Expand Down
10 changes: 4 additions & 6 deletions drivers/infiniband/hw/nes/nes_nic.c
Original file line number Diff line number Diff line change
Expand Up @@ -797,14 +797,13 @@ static int nes_netdev_set_mac_address(struct net_device *netdev, void *p)
int i;
u32 macaddr_low;
u16 macaddr_high;
DECLARE_MAC_BUF(mac);

if (!is_valid_ether_addr(mac_addr->sa_data))
return -EADDRNOTAVAIL;

memcpy(netdev->dev_addr, mac_addr->sa_data, netdev->addr_len);
printk(PFX "%s: Address length = %d, Address = %s\n",
__func__, netdev->addr_len, print_mac(mac, mac_addr->sa_data));
printk(PFX "%s: Address length = %d, Address = %pM\n",
__func__, netdev->addr_len, mac_addr->sa_data);
macaddr_high = ((u16)netdev->dev_addr[0]) << 8;
macaddr_high += (u16)netdev->dev_addr[1];
macaddr_low = ((u32)netdev->dev_addr[2]) << 24;
Expand Down Expand Up @@ -909,9 +908,8 @@ static void nes_netdev_set_multicast_list(struct net_device *netdev)
if (mc_index >= max_pft_entries_avaiable)
break;
if (multicast_addr) {
DECLARE_MAC_BUF(mac);
nes_debug(NES_DBG_NIC_RX, "Assigning MC Address %s to register 0x%04X nic_idx=%d\n",
print_mac(mac, multicast_addr->dmi_addr),
nes_debug(NES_DBG_NIC_RX, "Assigning MC Address %pM to register 0x%04X nic_idx=%d\n",
multicast_addr->dmi_addr,
perfect_filter_register_address+(mc_index * 8),
mc_nic_index);
macaddr_high = ((u16)multicast_addr->dmi_addr[0]) << 8;
Expand Down
3 changes: 1 addition & 2 deletions drivers/net/3c503.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ el2_probe1(struct net_device *dev, int ioaddr)
int i, iobase_reg, membase_reg, saved_406, wordlength, retval;
static unsigned version_printed;
unsigned long vendor_id;
DECLARE_MAC_BUF(mac);

if (!request_region(ioaddr, EL2_IO_EXTENT, DRV_NAME))
return -EBUSY;
Expand Down Expand Up @@ -228,7 +227,7 @@ el2_probe1(struct net_device *dev, int ioaddr)
/* Retrieve and print the ethernet address. */
for (i = 0; i < 6; i++)
dev->dev_addr[i] = inb(ioaddr + i);
printk("%s", print_mac(mac, dev->dev_addr));
printk("%pM", dev->dev_addr);

/* Map the 8390 back into the window. */
outb(ECNTRL_THIN, ioaddr + 0x406);
Expand Down
5 changes: 2 additions & 3 deletions drivers/net/3c505.c
Original file line number Diff line number Diff line change
Expand Up @@ -1385,7 +1385,6 @@ static int __init elplus_setup(struct net_device *dev)
unsigned long timeout;
unsigned long cookie = 0;
int err = -ENODEV;
DECLARE_MAC_BUF(mac);

/*
* setup adapter structure
Expand Down Expand Up @@ -1522,9 +1521,9 @@ static int __init elplus_setup(struct net_device *dev)
* print remainder of startup message
*/
printk(KERN_INFO "%s: 3c505 at %#lx, irq %d, dma %d, "
"addr %s, ",
"addr %pM, ",
dev->name, dev->base_addr, dev->irq, dev->dma,
print_mac(mac, dev->dev_addr));
dev->dev_addr);

/*
* read more information from the adapter
Expand Down
3 changes: 1 addition & 2 deletions drivers/net/3c507.c
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,6 @@ static int __init el16_probe1(struct net_device *dev, int ioaddr)
static unsigned char init_ID_done, version_printed;
int i, irq, irqval, retval;
struct net_local *lp;
DECLARE_MAC_BUF(mac);

if (init_ID_done == 0) {
ushort lrs_state = 0xff;
Expand Down Expand Up @@ -405,7 +404,7 @@ static int __init el16_probe1(struct net_device *dev, int ioaddr)
outb(0x01, ioaddr + MISC_CTRL);
for (i = 0; i < 6; i++)
dev->dev_addr[i] = inb(ioaddr + i);
printk(" %s", print_mac(mac, dev->dev_addr));
printk(" %pM", dev->dev_addr);

if (mem_start)
net_debug = mem_start & 7;
Expand Down
5 changes: 2 additions & 3 deletions drivers/net/3c509.c
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,6 @@ static int __init el3_common_init(struct net_device *dev)
{
struct el3_private *lp = netdev_priv(dev);
int err;
DECLARE_MAC_BUF(mac);
const char *if_names[] = {"10baseT", "AUI", "undefined", "BNC"};

spin_lock_init(&lp->lock);
Expand Down Expand Up @@ -575,9 +574,9 @@ static int __init el3_common_init(struct net_device *dev)
}

printk(KERN_INFO "%s: 3c5x9 found at %#3.3lx, %s port, "
"address %s, IRQ %d.\n",
"address %pM, IRQ %d.\n",
dev->name, dev->base_addr, if_names[(dev->if_port & 0x03)],
print_mac(mac, dev->dev_addr), dev->irq);
dev->dev_addr, dev->irq);

if (el3_debug > 0)
printk(KERN_INFO "%s", version);
Expand Down
3 changes: 1 addition & 2 deletions drivers/net/3c515.c
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,6 @@ static int corkscrew_setup(struct net_device *dev, int ioaddr,
unsigned int eeprom[0x40], checksum = 0; /* EEPROM contents */
int i;
int irq;
DECLARE_MAC_BUF(mac);

#ifdef __ISAPNP__
if (idev) {
Expand Down Expand Up @@ -636,7 +635,7 @@ static int corkscrew_setup(struct net_device *dev, int ioaddr,
checksum = (checksum ^ (checksum >> 8)) & 0xff;
if (checksum != 0x00)
printk(" ***INVALID CHECKSUM %4.4x*** ", checksum);
printk(" %s", print_mac(mac, dev->dev_addr));
printk(" %pM", dev->dev_addr);
if (eeprom[16] == 0x11c7) { /* Corkscrew */
if (request_dma(dev->dma, "3c515")) {
printk(", DMA %d allocation failed", dev->dma);
Expand Down
10 changes: 4 additions & 6 deletions drivers/net/3c523.c
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,6 @@ static int elmc_getinfo(char *buf, int slot, void *d)
{
int len = 0;
struct net_device *dev = d;
DECLARE_MAC_BUF(mac);

if (dev == NULL)
return len;
Expand All @@ -398,8 +397,8 @@ static int elmc_getinfo(char *buf, int slot, void *d)
len += sprintf(buf + len, "Transceiver: %s\n", dev->if_port ?
"External" : "Internal");
len += sprintf(buf + len, "Device: %s\n", dev->name);
len += sprintf(buf + len, "Hardware Address: %s\n",
print_mac(mac, dev->dev_addr));
len += sprintf(buf + len, "Hardware Address: %pM\n",
dev->dev_addr);

return len;
} /* elmc_getinfo() */
Expand All @@ -417,7 +416,6 @@ static int __init do_elmc_probe(struct net_device *dev)
unsigned int size = 0;
int retval;
struct priv *pr = dev->priv;
DECLARE_MAC_BUF(mac);

if (MCA_bus == 0) {
return -ENODEV;
Expand Down Expand Up @@ -543,8 +541,8 @@ static int __init do_elmc_probe(struct net_device *dev)
for (i = 0; i < 6; i++)
dev->dev_addr[i] = inb(dev->base_addr + i);

printk(KERN_INFO "%s: hardware address %s\n",
dev->name, print_mac(mac, dev->dev_addr));
printk(KERN_INFO "%s: hardware address %pM\n",
dev->name, dev->dev_addr);

dev->open = &elmc_open;
dev->stop = &elmc_close;
Expand Down
3 changes: 1 addition & 2 deletions drivers/net/3c527.c
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,6 @@ static int __init mc32_probe1(struct net_device *dev, int slot)
"82586 initialisation failure",
"Adapter list configuration error"
};
DECLARE_MAC_BUF(mac);

/* Time to play MCA games */

Expand Down Expand Up @@ -405,7 +404,7 @@ static int __init mc32_probe1(struct net_device *dev, int slot)
dev->dev_addr[i] = mca_read_pos(slot,3);
}

printk("%s: Address %s", dev->name, print_mac(mac, dev->dev_addr));
printk("%s: Address %pM", dev->name, dev->dev_addr);

mca_write_pos(slot, 6, 0);
mca_write_pos(slot, 7, 0);
Expand Down
3 changes: 1 addition & 2 deletions drivers/net/3c59x.c
Original file line number Diff line number Diff line change
Expand Up @@ -1013,7 +1013,6 @@ static int __devinit vortex_probe1(struct device *gendev,
const char *print_name = "3c59x";
struct pci_dev *pdev = NULL;
struct eisa_device *edev = NULL;
DECLARE_MAC_BUF(mac);

if (!printed_version) {
printk (version);
Expand Down Expand Up @@ -1206,7 +1205,7 @@ static int __devinit vortex_probe1(struct device *gendev,
((__be16 *)dev->dev_addr)[i] = htons(eeprom[i + 10]);
memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);
if (print_info)
printk(" %s", print_mac(mac, dev->dev_addr));
printk(" %pM", dev->dev_addr);
/* Unfortunately an all zero eeprom passes the checksum and this
gets found in the wild in failure cases. Crypto is hard 8) */
if (!is_valid_ether_addr(dev->dev_addr)) {
Expand Down
5 changes: 2 additions & 3 deletions drivers/net/8139cp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1826,7 +1826,6 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
void __iomem *regs;
resource_size_t pciaddr;
unsigned int addr_len, i, pci_using_dac;
DECLARE_MAC_BUF(mac);

#ifndef MODULE
static int version_printed;
Expand Down Expand Up @@ -1967,10 +1966,10 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
goto err_out_iomap;

printk (KERN_INFO "%s: RTL-8139C+ at 0x%lx, "
"%s, IRQ %d\n",
"%pM, IRQ %d\n",
dev->name,
dev->base_addr,
print_mac(mac, dev->dev_addr),
dev->dev_addr,
dev->irq);

pci_set_drvdata(pdev, dev);
Expand Down
5 changes: 2 additions & 3 deletions drivers/net/8139too.c
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,6 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev,
int i, addr_len, option;
void __iomem *ioaddr;
static int board_idx = -1;
DECLARE_MAC_BUF(mac);

assert (pdev != NULL);
assert (ent != NULL);
Expand Down Expand Up @@ -1024,11 +1023,11 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev,
pci_set_drvdata (pdev, dev);

printk (KERN_INFO "%s: %s at 0x%lx, "
"%s, IRQ %d\n",
"%pM, IRQ %d\n",
dev->name,
board_info[ent->driver_data].name,
dev->base_addr,
print_mac(mac, dev->dev_addr),
dev->dev_addr,
dev->irq);

printk (KERN_DEBUG "%s: Identified 8139 chip type '%s'\n",
Expand Down
13 changes: 4 additions & 9 deletions drivers/net/82596.c
Original file line number Diff line number Diff line change
Expand Up @@ -1116,12 +1116,8 @@ static int i596_start_xmit(struct sk_buff *skb, struct net_device *dev)

static void print_eth(unsigned char *add, char *str)
{
DECLARE_MAC_BUF(mac);
DECLARE_MAC_BUF(mac2);

printk(KERN_DEBUG "i596 0x%p, %s --> %s %02X%02X, %s\n",
add, print_mac(mac, add + 6), print_mac(mac2, add),
add[12], add[13], str);
printk(KERN_DEBUG "i596 0x%p, %pM --> %pM %02X%02X, %s\n",
add, add + 6, add, add[12], add[13], str);
}

static int io = 0x300;
Expand Down Expand Up @@ -1544,7 +1540,6 @@ static void set_multicast_list(struct net_device *dev)
struct dev_mc_list *dmi;
unsigned char *cp;
struct mc_cmd *cmd;
DECLARE_MAC_BUF(mac);

if (wait_cfg(dev, &lp->mc_cmd.cmd, 1000, "multicast list change request timed out"))
return;
Expand All @@ -1555,8 +1550,8 @@ static void set_multicast_list(struct net_device *dev)
for (dmi = dev->mc_list; cnt && dmi != NULL; dmi = dmi->next, cnt--, cp += 6) {
memcpy(cp, dmi->dmi_addr, 6);
if (i596_debug > 1)
DEB(DEB_MULTI,printk(KERN_INFO "%s: Adding address %s\n",
dev->name, print_mac(mac, cp)));
DEB(DEB_MULTI,printk(KERN_INFO "%s: Adding address %pM\n",
dev->name, cp));
}
i596_add_cmd(dev, &cmd->cmd);
}
Expand Down
4 changes: 1 addition & 3 deletions drivers/net/a2065.c
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,6 @@ static int __devinit a2065_init_one(struct zorro_dev *z,
unsigned long board, base_addr, mem_start;
struct resource *r1, *r2;
int err;
DECLARE_MAC_BUF(mac);

board = z->resource.start;
base_addr = board+A2065_LANCE;
Expand Down Expand Up @@ -787,8 +786,7 @@ static int __devinit a2065_init_one(struct zorro_dev *z,
zorro_set_drvdata(z, dev);

printk(KERN_INFO "%s: A2065 at 0x%08lx, Ethernet Address "
"%s\n", dev->name, board,
print_mac(mac, dev->dev_addr));
"%pM\n", dev->name, board, dev->dev_addr);

return 0;
}
Expand Down
Loading

0 comments on commit e174961

Please sign in to comment.