mirror of
https://github.com/torvalds/linux.git
synced 2024-11-26 22:21:42 +00:00
staging: use eth_hw_addr_set() for dev->addr_len cases
Convert all staging 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) Manually confirmed these are all etherdevices. Signed-off-by: Jakub Kicinski <kuba@kernel.org> Link: https://lore.kernel.org/r/20211019171243.1412240-4-kuba@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
349f631da4
commit
3928f64b1e
@ -2490,7 +2490,7 @@ int ks_wlan_set_mac_address(struct net_device *dev, void *addr)
|
||||
|
||||
if (netif_running(dev))
|
||||
return -EBUSY;
|
||||
memcpy(dev->dev_addr, mac_addr->sa_data, dev->addr_len);
|
||||
eth_hw_addr_set(dev, mac_addr->sa_data);
|
||||
ether_addr_copy(priv->eth_addr, mac_addr->sa_data);
|
||||
|
||||
priv->mac_address_valid = false;
|
||||
|
@ -724,9 +724,7 @@ static int qlge_get_8000_flash_params(struct qlge_adapter *qdev)
|
||||
goto exit;
|
||||
}
|
||||
|
||||
memcpy(qdev->ndev->dev_addr,
|
||||
mac_addr,
|
||||
qdev->ndev->addr_len);
|
||||
eth_hw_addr_set(qdev->ndev, mac_addr);
|
||||
|
||||
exit:
|
||||
qlge_sem_unlock(qdev, SEM_FLASH_MASK);
|
||||
@ -774,9 +772,7 @@ static int qlge_get_8012_flash_params(struct qlge_adapter *qdev)
|
||||
goto exit;
|
||||
}
|
||||
|
||||
memcpy(qdev->ndev->dev_addr,
|
||||
qdev->flash.flash_params_8012.mac_addr,
|
||||
qdev->ndev->addr_len);
|
||||
eth_hw_addr_set(qdev->ndev, qdev->flash.flash_params_8012.mac_addr);
|
||||
|
||||
exit:
|
||||
qlge_sem_unlock(qdev, SEM_FLASH_MASK);
|
||||
@ -4214,7 +4210,7 @@ static int qlge_set_mac_address(struct net_device *ndev, void *p)
|
||||
|
||||
if (!is_valid_ether_addr(addr->sa_data))
|
||||
return -EADDRNOTAVAIL;
|
||||
memcpy(ndev->dev_addr, addr->sa_data, ndev->addr_len);
|
||||
eth_hw_addr_set(ndev, addr->sa_data);
|
||||
/* Update local copy of current mac address. */
|
||||
memcpy(qdev->current_mac_addr, ndev->dev_addr, ndev->addr_len);
|
||||
|
||||
|
@ -616,7 +616,7 @@ static int p80211knetdev_set_mac_address(struct net_device *dev, void *addr)
|
||||
result = -EADDRNOTAVAIL;
|
||||
} else {
|
||||
/* everything's ok, change the addr in netdev */
|
||||
memcpy(dev->dev_addr, new_addr->sa_data, dev->addr_len);
|
||||
eth_hw_addr_set(dev, new_addr->sa_data);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
Loading…
Reference in New Issue
Block a user