summaryrefslogtreecommitdiffstats
path: root/drivers/staging/qlge
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2021-10-19 10:12:38 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-10-20 19:33:58 +0200
commit3928f64b1e473ec951cfbeac42634ff51d4f7f33 (patch)
tree2d20e99dde0d92d80559f50c064c84b44ef4180a /drivers/staging/qlge
parent349f631da4e1bdcb1b4a2a3ee630d689bfe6724d (diff)
downloadlinux-3928f64b1e473ec951cfbeac42634ff51d4f7f33.tar.gz
linux-3928f64b1e473ec951cfbeac42634ff51d4f7f33.tar.bz2
linux-3928f64b1e473ec951cfbeac42634ff51d4f7f33.zip
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>
Diffstat (limited to 'drivers/staging/qlge')
-rw-r--r--drivers/staging/qlge/qlge_main.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/staging/qlge/qlge_main.c b/drivers/staging/qlge/qlge_main.c
index 8fcdf89da8aa..abb7844f92fb 100644
--- a/drivers/staging/qlge/qlge_main.c
+++ b/drivers/staging/qlge/qlge_main.c
@@ -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);