From: Tobias Klauser Date: Fri, 17 Mar 2017 10:52:15 +0000 (+0100) Subject: net: ethoc: Use ether_addr_copy() X-Git-Tag: MMI-PSA29.97-13-9~5649^3~405 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=de6b08fd82087778c579dc3f3c28bb1c878a993a;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git 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 Reviewed-by: Thierry Reding Signed-off-by: David S. Miller --- 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; }