mirror of
https://github.com/torvalds/linux.git
synced 2024-11-23 04:31:50 +00:00
staging: use eth_hw_addr_set() instead of ether_addr_copy()
Commit 406f42fa0d
("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.
Convert staging 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: Jakub Kicinski <kuba@kernel.org>
Link: https://lore.kernel.org/r/20211019171243.1412240-3-kuba@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
6ed178cb23
commit
349f631da4
@ -541,7 +541,7 @@ void hostif_mib_get_confirm(struct ks_wlan_private *priv)
|
||||
hostif_sme_enqueue(priv, SME_GET_MAC_ADDRESS);
|
||||
ether_addr_copy(priv->eth_addr, priv->rxp);
|
||||
priv->mac_address_valid = true;
|
||||
ether_addr_copy(dev->dev_addr, priv->eth_addr);
|
||||
eth_hw_addr_set(dev, priv->eth_addr);
|
||||
netdev_info(dev, "MAC ADDRESS = %pM\n", priv->eth_addr);
|
||||
break;
|
||||
case DOT11_PRODUCT_VERSION:
|
||||
|
@ -2625,7 +2625,7 @@ int ks_wlan_net_start(struct net_device *dev)
|
||||
|
||||
/* dummy address set */
|
||||
ether_addr_copy(priv->eth_addr, dummy_addr);
|
||||
ether_addr_copy(dev->dev_addr, priv->eth_addr);
|
||||
eth_hw_addr_set(dev, priv->eth_addr);
|
||||
|
||||
/* The ks_wlan-specific entries in the device structure. */
|
||||
dev->netdev_ops = &ks_wlan_netdev_ops;
|
||||
|
@ -564,7 +564,7 @@ static void on_netinfo(struct most_interface *iface,
|
||||
if (m && is_valid_ether_addr(m)) {
|
||||
if (!is_valid_ether_addr(dev->dev_addr)) {
|
||||
netdev_info(dev, "set mac %pM\n", m);
|
||||
ether_addr_copy(dev->dev_addr, m);
|
||||
eth_hw_addr_set(dev, m);
|
||||
netif_dormant_off(dev);
|
||||
} else if (!ether_addr_equal(dev->dev_addr, m)) {
|
||||
netdev_warn(dev, "reject mac %pM\n", m);
|
||||
|
@ -366,7 +366,7 @@ static void _rtl92e_read_eeprom_info(struct net_device *dev)
|
||||
*(u16 *)(&dev->dev_addr[i]) = usValue;
|
||||
}
|
||||
} else {
|
||||
ether_addr_copy(dev->dev_addr, bMac_Tmp_Addr);
|
||||
eth_hw_addr_set(dev, bMac_Tmp_Addr);
|
||||
}
|
||||
|
||||
RT_TRACE(COMP_INIT, "Permanent Address = %pM\n",
|
||||
|
@ -2235,7 +2235,7 @@ static int _rtl92e_set_mac_adr(struct net_device *dev, void *mac)
|
||||
|
||||
mutex_lock(&priv->wx_mutex);
|
||||
|
||||
ether_addr_copy(dev->dev_addr, addr->sa_data);
|
||||
eth_hw_addr_set(dev, addr->sa_data);
|
||||
|
||||
schedule_work(&priv->reset_wq);
|
||||
mutex_unlock(&priv->wx_mutex);
|
||||
|
@ -3454,7 +3454,7 @@ static int r8192_set_mac_adr(struct net_device *dev, void *mac)
|
||||
|
||||
mutex_lock(&priv->wx_mutex);
|
||||
|
||||
ether_addr_copy(dev->dev_addr, addr->sa_data);
|
||||
eth_hw_addr_set(dev, addr->sa_data);
|
||||
|
||||
schedule_work(&priv->reset_wq);
|
||||
mutex_unlock(&priv->wx_mutex);
|
||||
|
@ -166,7 +166,7 @@ static int r871x_net_set_mac_address(struct net_device *pnetdev, void *p)
|
||||
struct sockaddr *addr = p;
|
||||
|
||||
if (!padapter->bup)
|
||||
ether_addr_copy(pnetdev->dev_addr, addr->sa_data);
|
||||
eth_hw_addr_set(pnetdev, addr->sa_data);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -563,7 +563,7 @@ static int r871xu_drv_init(struct usb_interface *pusb_intf,
|
||||
dev_info(&udev->dev,
|
||||
"r8712u: MAC Address from efuse = %pM\n", mac);
|
||||
}
|
||||
ether_addr_copy(pnetdev->dev_addr, mac);
|
||||
eth_hw_addr_set(pnetdev, mac);
|
||||
}
|
||||
/* step 6. Load the firmware asynchronously */
|
||||
if (rtl871x_load_fw(padapter))
|
||||
|
Loading…
Reference in New Issue
Block a user