Commit e174961c authored by Johannes Berg's avatar Johannes Berg Committed by David S. Miller
Browse files

net: convert print_mac to %pM



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: default avatarJohannes Berg <johannes@sipsolutions.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0c68ae26
......@@ -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();
......@@ -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);
}
......
......@@ -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;
......@@ -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);
}
......
......@@ -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;
......@@ -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);
}
......
......@@ -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);
}
/**
......
......@@ -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);
......@@ -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,
......@@ -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);
......@@ -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);
......
......@@ -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;
......@@ -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;
......
......@@ -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;
......@@ -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);
......
......@@ -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
......@@ -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
......
......@@ -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;
......@@ -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;
......
......@@ -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);
......@@ -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);
......
......@@ -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) {
......@@ -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);
......
......@@ -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;
......@@ -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() */
......@@ -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;
......@@ -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;
......
......@@ -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 */
......@@ -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);
......
......@@ -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);
......@@ -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)) {
......
......@@ -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;
......@@ -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);
......
......@@ -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);
......@@ -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",
......
......@@ -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;
......@@ -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;
......@@ -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);
}
......
......@@ -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;
......@@ -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;
}
......
......@@ -146,7 +146,6 @@ out:
static int __init ac_probe1(int ioaddr, struct net_device *dev)
{
int i, retval;
DECLARE_MAC_BUF(mac);
if (!request_region(ioaddr, AC_IO_EXTENT, DRV_NAME))
return -EBUSY;
......@@ -171,8 +170,8 @@ static int __init ac_probe1(int ioaddr, struct net_device *dev)
for (i = 0; i < 6; i++)
dev->dev_addr[i] = inb(ioaddr + AC_SA_PROM + i);
printk(KERN_DEBUG "AC3200 in EISA slot %d, node %s",
ioaddr/0x1000, print_mac(mac, dev->dev_addr));
printk(KERN_DEBUG "AC3200 in EISA slot %d, node %pM",
ioaddr/0x1000, dev->dev_addr);
#if 0
/* Check the vendor ID/prefix. Redundant after checking the EISA ID */
if (inb(ioaddr + AC_SA_PROM + 0) != AC_ADDR0
......
......@@ -892,7 +892,6 @@ static int __devinit ace_init(struct net_device *dev)
int board_idx, ecode = 0;
short i;
unsigned char cache_size;
DECLARE_MAC_BUF(mac);
ap = netdev_priv(dev);
regs = ap->regs;
......@@ -1019,7 +1018,7 @@ static int __devinit ace_init(struct net_device *dev)
dev->dev_addr[4] = (mac2 >> 8) & 0xff;
dev->dev_addr[5] = mac2 & 0xff;
printk("MAC: %s\n", print_mac(mac, dev->dev_addr));
printk("MAC: %pM\n", dev->dev_addr);
/*
* Looks like this is necessary to deal with on all architectures,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment