Commit e35b8d7d authored by Jakub Kicinski's avatar Jakub Kicinski Committed by David S. Miller

net: use eth_hw_addr_set() instead of ether_addr_copy()

Convert from ether_addr_copy() to eth_hw_addr_set():

  @@
  expression dev, np;
  @@
  - ether_addr_copy(dev->dev_addr, np)
  + eth_hw_addr_set(dev, np)
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 16813717
...@@ -787,7 +787,7 @@ static int ipvlan_device_event(struct notifier_block *unused, ...@@ -787,7 +787,7 @@ static int ipvlan_device_event(struct notifier_block *unused,
case NETDEV_CHANGEADDR: case NETDEV_CHANGEADDR:
list_for_each_entry(ipvlan, &port->ipvlans, pnode) { list_for_each_entry(ipvlan, &port->ipvlans, pnode) {
ether_addr_copy(ipvlan->dev->dev_addr, dev->dev_addr); eth_hw_addr_set(ipvlan->dev, dev->dev_addr);
call_netdevice_notifiers(NETDEV_CHANGEADDR, ipvlan->dev); call_netdevice_notifiers(NETDEV_CHANGEADDR, ipvlan->dev);
} }
break; break;
......
...@@ -3614,7 +3614,7 @@ static int macsec_set_mac_address(struct net_device *dev, void *p) ...@@ -3614,7 +3614,7 @@ static int macsec_set_mac_address(struct net_device *dev, void *p)
dev_uc_del(real_dev, dev->dev_addr); dev_uc_del(real_dev, dev->dev_addr);
out: out:
ether_addr_copy(dev->dev_addr, addr->sa_data); eth_hw_addr_set(dev, addr->sa_data);
macsec->secy.sci = dev_to_sci(dev, MACSEC_PORT_ES); macsec->secy.sci = dev_to_sci(dev, MACSEC_PORT_ES);
/* If h/w offloading is available, propagate to the device */ /* If h/w offloading is available, propagate to the device */
......
...@@ -707,7 +707,7 @@ static int macvlan_sync_address(struct net_device *dev, unsigned char *addr) ...@@ -707,7 +707,7 @@ static int macvlan_sync_address(struct net_device *dev, unsigned char *addr)
if (!(dev->flags & IFF_UP)) { if (!(dev->flags & IFF_UP)) {
/* Just copy in the new address */ /* Just copy in the new address */
ether_addr_copy(dev->dev_addr, addr); eth_hw_addr_set(dev, addr);
} else { } else {
/* Rehash and update the device filters */ /* Rehash and update the device filters */
if (macvlan_addr_busy(vlan->port, addr)) if (macvlan_addr_busy(vlan->port, addr))
......
...@@ -250,7 +250,7 @@ bool vlan_dev_inherit_address(struct net_device *dev, ...@@ -250,7 +250,7 @@ bool vlan_dev_inherit_address(struct net_device *dev,
if (dev->addr_assign_type != NET_ADDR_STOLEN) if (dev->addr_assign_type != NET_ADDR_STOLEN)
return false; return false;
ether_addr_copy(dev->dev_addr, real_dev->dev_addr); eth_hw_addr_set(dev, real_dev->dev_addr);
call_netdevice_notifiers(NETDEV_CHANGEADDR, dev); call_netdevice_notifiers(NETDEV_CHANGEADDR, dev);
return true; return true;
} }
...@@ -349,7 +349,7 @@ static int vlan_dev_set_mac_address(struct net_device *dev, void *p) ...@@ -349,7 +349,7 @@ static int vlan_dev_set_mac_address(struct net_device *dev, void *p)
dev_uc_del(real_dev, dev->dev_addr); dev_uc_del(real_dev, dev->dev_addr);
out: out:
ether_addr_copy(dev->dev_addr, addr->sa_data); eth_hw_addr_set(dev, addr->sa_data);
return 0; return 0;
} }
...@@ -586,7 +586,7 @@ static int vlan_dev_init(struct net_device *dev) ...@@ -586,7 +586,7 @@ static int vlan_dev_init(struct net_device *dev)
dev->dev_id = real_dev->dev_id; dev->dev_id = real_dev->dev_id;
if (is_zero_ether_addr(dev->dev_addr)) { if (is_zero_ether_addr(dev->dev_addr)) {
ether_addr_copy(dev->dev_addr, real_dev->dev_addr); eth_hw_addr_set(dev, real_dev->dev_addr);
dev->addr_assign_type = NET_ADDR_STOLEN; dev->addr_assign_type = NET_ADDR_STOLEN;
} }
if (is_zero_ether_addr(dev->broadcast)) if (is_zero_ether_addr(dev->broadcast))
......
...@@ -174,7 +174,7 @@ static int dsa_slave_set_mac_address(struct net_device *dev, void *a) ...@@ -174,7 +174,7 @@ static int dsa_slave_set_mac_address(struct net_device *dev, void *a)
dev_uc_del(master, dev->dev_addr); dev_uc_del(master, dev->dev_addr);
out: out:
ether_addr_copy(dev->dev_addr, addr->sa_data); eth_hw_addr_set(dev, addr->sa_data);
return 0; return 0;
} }
...@@ -1954,7 +1954,7 @@ int dsa_slave_create(struct dsa_port *port) ...@@ -1954,7 +1954,7 @@ int dsa_slave_create(struct dsa_port *port)
slave_dev->ethtool_ops = &dsa_slave_ethtool_ops; slave_dev->ethtool_ops = &dsa_slave_ethtool_ops;
if (!is_zero_ether_addr(port->mac)) if (!is_zero_ether_addr(port->mac))
ether_addr_copy(slave_dev->dev_addr, port->mac); eth_hw_addr_set(slave_dev, port->mac);
else else
eth_hw_addr_inherit(slave_dev, master); eth_hw_addr_inherit(slave_dev, master);
slave_dev->priv_flags |= IFF_NO_QUEUE; slave_dev->priv_flags |= IFF_NO_QUEUE;
......
...@@ -493,7 +493,7 @@ int hsr_dev_finalize(struct net_device *hsr_dev, struct net_device *slave[2], ...@@ -493,7 +493,7 @@ int hsr_dev_finalize(struct net_device *hsr_dev, struct net_device *slave[2],
INIT_LIST_HEAD(&hsr->self_node_db); INIT_LIST_HEAD(&hsr->self_node_db);
spin_lock_init(&hsr->list_lock); spin_lock_init(&hsr->list_lock);
ether_addr_copy(hsr_dev->dev_addr, slave[0]->dev_addr); eth_hw_addr_set(hsr_dev, slave[0]->dev_addr);
/* initialize protocol specific functions */ /* initialize protocol specific functions */
if (protocol_version == PRP_V1) { if (protocol_version == PRP_V1) {
......
...@@ -75,7 +75,7 @@ static int hsr_netdev_notify(struct notifier_block *nb, unsigned long event, ...@@ -75,7 +75,7 @@ static int hsr_netdev_notify(struct notifier_block *nb, unsigned long event,
master = hsr_port_get_hsr(hsr, HSR_PT_MASTER); master = hsr_port_get_hsr(hsr, HSR_PT_MASTER);
if (port->type == HSR_PT_SLAVE_A) { if (port->type == HSR_PT_SLAVE_A) {
ether_addr_copy(master->dev->dev_addr, dev->dev_addr); eth_hw_addr_set(master->dev, dev->dev_addr);
call_netdevice_notifiers(NETDEV_CHANGEADDR, call_netdevice_notifiers(NETDEV_CHANGEADDR,
master->dev); master->dev);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment