diff options
author | Jakub Kicinski <kuba@kernel.org> | 2021-10-13 22:44:32 +0200 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2021-10-14 18:22:19 +0200 |
commit | c51e5062c18067ccdc85798c2051edfc37e2475d (patch) | |
tree | b1db6aa8ffd5025c60317701cb29b5676156726c /drivers/net/ethernet/dnet.c | |
parent | ethernet: make use of eth_hw_addr_random() where appropriate (diff) | |
download | linux-c51e5062c18067ccdc85798c2051edfc37e2475d.tar.xz linux-c51e5062c18067ccdc85798c2051edfc37e2475d.zip |
ethernet: manually convert memcpy(dev_addr,..., sizeof(addr))
A handful of drivers use sizeof(addr) for the size of
the address, after manually confirming the size is
indeed 6 convert them to eth_hw_addr_set().
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Acked-by: Petko Manolov <petkan@nucleusys.com>
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/ethernet/dnet.c')
-rw-r--r-- | drivers/net/ethernet/dnet.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/dnet.c b/drivers/net/ethernet/dnet.c index 3ed21ba4eb99..92462ed87bc4 100644 --- a/drivers/net/ethernet/dnet.c +++ b/drivers/net/ethernet/dnet.c @@ -93,7 +93,7 @@ static void dnet_get_hwaddr(struct dnet *bp) *((__be16 *)(addr + 4)) = cpu_to_be16(tmp); if (is_valid_ether_addr(addr)) - memcpy(bp->dev->dev_addr, addr, sizeof(addr)); + eth_hw_addr_set(bp->dev, addr); } static int dnet_mdio_read(struct mii_bus *bus, int mii_id, int regnum) |