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

Merge branch 'hw_addr_set'



Jakub Kicinski says:

====================
Use netdev->dev_addr write helpers (part 1)

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 is the first installment of predictably tedious conversion.
It tackles:

  memcpy(netdev->dev_addr, something, ETH_ADDR)

and

  ether_addr_copy(netdev->dev_addr, something)

replacing both with eth_hw_addr_set().

The first 7 patches are done entirely by sparse.
Next 4 were semi-manual because the sparse conversion
resulted in errors.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents fa8274b7 16be9a16
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -200,7 +200,7 @@ static struct net_device * __init nfeth_probe(int unit)
	dev->irq = nfEtherIRQ;
	dev->netdev_ops = &nfeth_netdev_ops;

	memcpy(dev->dev_addr, mac, ETH_ALEN);
	eth_hw_addr_set(dev, mac);

	priv = netdev_priv(dev);
	priv->ethX = unit;
+1 −1
Original line number Diff line number Diff line
@@ -467,7 +467,7 @@ static int iss_net_set_mac(struct net_device *dev, void *addr)
	if (!is_valid_ether_addr(hwaddr->sa_data))
		return -EADDRNOTAVAIL;
	spin_lock_bh(&lp->lock);
	memcpy(dev->dev_addr, hwaddr->sa_data, ETH_ALEN);
	eth_hw_addr_set(dev, hwaddr->sa_data);
	spin_unlock_bh(&lp->lock);
	return 0;
}
+1 −1
Original line number Diff line number Diff line
@@ -270,7 +270,7 @@ static void el3_dev_fill(struct net_device *dev, __be16 *phys_addr, int ioaddr,
{
	struct el3_private *lp = netdev_priv(dev);

	memcpy(dev->dev_addr, phys_addr, ETH_ALEN);
	eth_hw_addr_set(dev, (u8 *)phys_addr);
	dev->base_addr = ioaddr;
	dev->irq = irq;
	dev->if_port = if_port;
+3 −3
Original line number Diff line number Diff line
@@ -716,7 +716,7 @@ static int ax_init_dev(struct net_device *dev)
			for (i = 0; i < 16; i++)
				SA_prom[i] = SA_prom[i+i];

		memcpy(dev->dev_addr, SA_prom, ETH_ALEN);
		eth_hw_addr_set(dev, SA_prom);
	}

#ifdef CONFIG_AX88796_93CX6
@@ -733,7 +733,7 @@ static int ax_init_dev(struct net_device *dev)
				       (__le16 __force *)mac_addr,
				       sizeof(mac_addr) >> 1);

		memcpy(dev->dev_addr, mac_addr, ETH_ALEN);
		eth_hw_addr_set(dev, mac_addr);
	}
#endif
	if (ax->plat->wordlength == 2) {
@@ -757,7 +757,7 @@ static int ax_init_dev(struct net_device *dev)

	if ((ax->plat->flags & AXFLG_MAC_FROMPLATFORM) &&
	    ax->plat->mac_addr)
		memcpy(dev->dev_addr, ax->plat->mac_addr, ETH_ALEN);
		eth_hw_addr_set(dev, ax->plat->mac_addr);

	if (!is_valid_ether_addr(dev->dev_addr)) {
		eth_hw_addr_random(dev);
+2 −2
Original line number Diff line number Diff line
@@ -3863,7 +3863,7 @@ static int et131x_change_mtu(struct net_device *netdev, int new_mtu)

	et131x_init_send(adapter);
	et131x_hwaddr_init(adapter);
	ether_addr_copy(netdev->dev_addr, adapter->addr);
	eth_hw_addr_set(netdev, adapter->addr);

	/* Init the device with the new settings */
	et131x_adapter_setup(adapter);
@@ -3966,7 +3966,7 @@ static int et131x_pci_setup(struct pci_dev *pdev,

	netif_napi_add(netdev, &adapter->napi, et131x_poll, 64);

	ether_addr_copy(netdev->dev_addr, adapter->addr);
	eth_hw_addr_set(netdev, adapter->addr);

	rc = -ENOMEM;

Loading