summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/atheros/atl1e
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2021-10-04 09:05:21 -0700
committerDavid S. Miller <davem@davemloft.net>2021-10-05 13:16:48 +0100
commita05e4c0af490ca7c22fc77120aafebebdeaaf537 (patch)
tree093f856055c374789e43c55e5b4f8842e1f513fb /drivers/net/ethernet/atheros/atl1e
parent5e8fba848eaadb7394ffe88c0b2508ff2e2c9832 (diff)
downloadlinux-a05e4c0af490ca7c22fc77120aafebebdeaaf537.tar.gz
linux-a05e4c0af490ca7c22fc77120aafebebdeaaf537.tar.bz2
linux-a05e4c0af490ca7c22fc77120aafebebdeaaf537.zip
ethernet: use eth_hw_addr_set() for dev->addr_len cases
Convert all Ethernet drivers from memcpy(... dev->addr_len) to eth_hw_addr_set(): @@ expression dev, np; @@ - memcpy(dev->dev_addr, np, dev->addr_len) + eth_hw_addr_set(dev, np) In theory addr_len may not be ETH_ALEN, but we don't expect non-Ethernet devices to live under this directory, and only the following cases of setting addr_len exist: - cxgb4 for mgmt device, and the drivers which set it to ETH_ALEN: s2io, mlx4, vxge. Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/atheros/atl1e')
-rw-r--r--drivers/net/ethernet/atheros/atl1e/atl1e_main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/atheros/atl1e/atl1e_main.c b/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
index 2e22483a9040..56e5f440e666 100644
--- a/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
+++ b/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
@@ -374,7 +374,7 @@ static int atl1e_set_mac_addr(struct net_device *netdev, void *p)
if (netif_running(netdev))
return -EBUSY;
- memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
+ eth_hw_addr_set(netdev, addr->sa_data);
memcpy(adapter->hw.mac_addr, addr->sa_data, netdev->addr_len);
atl1e_hw_set_mac_addr(&adapter->hw);
@@ -2390,7 +2390,7 @@ static int atl1e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
goto err_eeprom;
}
- memcpy(netdev->dev_addr, adapter->hw.mac_addr, netdev->addr_len);
+ eth_hw_addr_set(netdev, adapter->hw.mac_addr);
netdev_dbg(netdev, "mac address : %pM\n", adapter->hw.mac_addr);
INIT_WORK(&adapter->reset_task, atl1e_reset_task);