mirror of
https://github.com/torvalds/linux.git
synced 2024-11-25 05:32:00 +00:00
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>
This commit is contained in:
parent
4e9b9de65c
commit
2f23e5cef3
@ -2536,7 +2536,7 @@ static int netvsc_probe(struct hv_device *dev,
|
||||
goto rndis_failed;
|
||||
}
|
||||
|
||||
memcpy(net->dev_addr, device_info->mac_adr, ETH_ALEN);
|
||||
eth_hw_addr_set(net, device_info->mac_adr);
|
||||
|
||||
/* We must get rtnl lock before scheduling nvdev->subchan_work,
|
||||
* otherwise netvsc_subchan_work() can get rtnl lock first and wait
|
||||
|
@ -579,7 +579,7 @@ int ipvlan_link_new(struct net *src_net, struct net_device *dev,
|
||||
* world but keep using the physical-dev address for the outgoing
|
||||
* packets.
|
||||
*/
|
||||
memcpy(dev->dev_addr, phy_dev->dev_addr, ETH_ALEN);
|
||||
eth_hw_addr_set(dev, phy_dev->dev_addr);
|
||||
|
||||
dev->priv_flags |= IFF_NO_RX_HANDLER;
|
||||
|
||||
|
@ -202,7 +202,7 @@ static void macvlan_hash_change_addr(struct macvlan_dev *vlan,
|
||||
/* Now that we are unhashed it is safe to change the device
|
||||
* address without confusing packet delivery.
|
||||
*/
|
||||
memcpy(vlan->dev->dev_addr, addr, ETH_ALEN);
|
||||
eth_hw_addr_set(vlan->dev, addr);
|
||||
macvlan_hash_add(vlan);
|
||||
}
|
||||
|
||||
|
@ -233,7 +233,7 @@ void br_stp_change_bridge_id(struct net_bridge *br, const unsigned char *addr)
|
||||
|
||||
memcpy(oldaddr, br->bridge_id.addr, ETH_ALEN);
|
||||
memcpy(br->bridge_id.addr, addr, ETH_ALEN);
|
||||
memcpy(br->dev->dev_addr, addr, ETH_ALEN);
|
||||
eth_hw_addr_set(br->dev, addr);
|
||||
|
||||
list_for_each_entry(p, &br->port_list, list) {
|
||||
if (ether_addr_equal(p->designated_bridge.addr, oldaddr))
|
||||
|
Loading…
Reference in New Issue
Block a user