diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2017-03-17 11:52:15 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-03-21 17:16:56 -0700 |
commit | de6b08fd82087778c579dc3f3c28bb1c878a993a (patch) | |
tree | 84e2fff26c7bfe057c8064da55bf7e31ecb496a2 /drivers | |
parent | 0ed48440979b9fe870869be8be30dcf679aa27d3 (diff) | |
download | lwn-de6b08fd82087778c579dc3f3c28bb1c878a993a.tar.gz lwn-de6b08fd82087778c579dc3f3c28bb1c878a993a.zip |
net: ethoc: Use ether_addr_copy()
Use ether_addr_copy() instead of memcpy() to set netdev->dev_addr (which
is 2-byte aligned).
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Reviewed-by: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/ethoc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/ethoc.c b/drivers/net/ethernet/ethoc.c index 23d82748f52b..e863ba74d005 100644 --- a/drivers/net/ethernet/ethoc.c +++ b/drivers/net/ethernet/ethoc.c @@ -1148,14 +1148,14 @@ static int ethoc_probe(struct platform_device *pdev) /* Allow the platform setup code to pass in a MAC address. */ if (pdata) { - memcpy(netdev->dev_addr, pdata->hwaddr, IFHWADDRLEN); + ether_addr_copy(netdev->dev_addr, pdata->hwaddr); priv->phy_id = pdata->phy_id; } else { const void *mac; mac = of_get_mac_address(pdev->dev.of_node); if (mac) - memcpy(netdev->dev_addr, mac, IFHWADDRLEN); + ether_addr_copy(netdev->dev_addr, mac); priv->phy_id = -1; } |