Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: use eth_hw_addr_set()

Convert sw drivers from memcpy(... ETH_ADDR) to eth_hw_addr_set():

@@
expression dev, np;
@@
- memcpy(dev->dev_addr, np, ETH_ALEN)
+ eth_hw_addr_set(dev, np)

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Jakub Kicinski and committed by
David S. Miller
2f23e5ce 4e9b9de6

+4 -4
+1 -1
drivers/net/hyperv/netvsc_drv.c
··· 2536 2536 goto rndis_failed; 2537 2537 } 2538 2538 2539 - memcpy(net->dev_addr, device_info->mac_adr, ETH_ALEN); 2539 + eth_hw_addr_set(net, device_info->mac_adr); 2540 2540 2541 2541 /* We must get rtnl lock before scheduling nvdev->subchan_work, 2542 2542 * otherwise netvsc_subchan_work() can get rtnl lock first and wait
+1 -1
drivers/net/ipvlan/ipvlan_main.c
··· 579 579 * world but keep using the physical-dev address for the outgoing 580 580 * packets. 581 581 */ 582 - memcpy(dev->dev_addr, phy_dev->dev_addr, ETH_ALEN); 582 + eth_hw_addr_set(dev, phy_dev->dev_addr); 583 583 584 584 dev->priv_flags |= IFF_NO_RX_HANDLER; 585 585
+1 -1
drivers/net/macvlan.c
··· 202 202 /* Now that we are unhashed it is safe to change the device 203 203 * address without confusing packet delivery. 204 204 */ 205 - memcpy(vlan->dev->dev_addr, addr, ETH_ALEN); 205 + eth_hw_addr_set(vlan->dev, addr); 206 206 macvlan_hash_add(vlan); 207 207 } 208 208
+1 -1
net/bridge/br_stp_if.c
··· 233 233 234 234 memcpy(oldaddr, br->bridge_id.addr, ETH_ALEN); 235 235 memcpy(br->bridge_id.addr, addr, ETH_ALEN); 236 - memcpy(br->dev->dev_addr, addr, ETH_ALEN); 236 + eth_hw_addr_set(br->dev, addr); 237 237 238 238 list_for_each_entry(p, &br->port_list, list) { 239 239 if (ether_addr_equal(p->designated_bridge.addr, oldaddr))