Commit 794a69b3 authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'dev_addr-direct-writes'



Jakub Kicinski says:

====================
net: remove direct netdev->dev_addr writes

Commit 406f42fa ("net-next: When a bond have a massive amount
of VLANs...") introduced a rbtree for faster Ethernet address look
up. To maintain netdev->dev_addr in this tree we need to make all
the writes to it got through appropriate helpers.

This series contains top 5 conversions in terms of LoC required
to bring the driver into compliance.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents f12e658c 8ce218b6
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -320,8 +320,7 @@ static int __init apne_probe1(struct net_device *dev, int ioaddr)
    i = request_irq(dev->irq, apne_interrupt, IRQF_SHARED, DRV_NAME, dev);
    if (i) return i;

    for (i = 0; i < ETH_ALEN; i++)
	dev->dev_addr[i] = SA_prom[i];
    eth_hw_addr_set(dev, SA_prom);

    pr_cont(" %pM\n", dev->dev_addr);

+4 −2
Original line number Diff line number Diff line
@@ -748,11 +748,13 @@ static int ax_init_dev(struct net_device *dev)

	/* load the mac-address from the device */
	if (ax->plat->flags & AXFLG_MAC_FROMDEV) {
		u8 addr[ETH_ALEN];

		ei_outb(E8390_NODMA + E8390_PAGE1 + E8390_STOP,
			ei_local->mem + E8390_CMD); /* 0x61 */
		for (i = 0; i < ETH_ALEN; i++)
			dev->dev_addr[i] =
				ei_inb(ioaddr + EN1_PHYS_SHIFT(i));
			addr[i] = ei_inb(ioaddr + EN1_PHYS_SHIFT(i));
		eth_hw_addr_set(dev, addr);
	}

	if ((ax->plat->flags & AXFLG_MAC_FROMPLATFORM) &&
+5 −2
Original line number Diff line number Diff line
@@ -187,6 +187,7 @@ static int get_prom(struct pcmcia_device *link)
{
    struct net_device *dev = link->priv;
    unsigned int ioaddr = dev->base_addr;
    u8 addr[ETH_ALEN];
    int i, j;

    /* This is based on drivers/net/ethernet/8390/ne.c */
@@ -220,9 +221,11 @@ static int get_prom(struct pcmcia_device *link)

    for (i = 0; i < 6; i += 2) {
	j = inw(ioaddr + AXNET_DATAPORT);
	dev->dev_addr[i] = j & 0xff;
	dev->dev_addr[i+1] = j >> 8;
	addr[i] = j & 0xff;
	addr[i+1] = j >> 8;
    }
    eth_hw_addr_set(dev, addr);

    return 1;
} /* get_prom */

+1 −2
Original line number Diff line number Diff line
@@ -374,8 +374,7 @@ static int mcf8390_init(struct net_device *dev)
	if (ret)
		return ret;

	for (i = 0; i < ETH_ALEN; i++)
		dev->dev_addr[i] = SA_prom[i];
	eth_hw_addr_set(dev, SA_prom);

	netdev_dbg(dev, "Found ethernet address: %pM\n", dev->dev_addr);

+1 −3
Original line number Diff line number Diff line
@@ -500,9 +500,7 @@ static int __init ne_probe1(struct net_device *dev, unsigned long ioaddr)

	dev->base_addr = ioaddr;

	for (i = 0; i < ETH_ALEN; i++) {
		dev->dev_addr[i] = SA_prom[i];
	}
	eth_hw_addr_set(dev, SA_prom);

	pr_cont("%pM\n", dev->dev_addr);

Loading