Skip to content

Commit

Permalink
net: ethoc: Use ether_addr_copy()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Tobias Klauser authored and David S. Miller committed Mar 22, 2017
1 parent 0ed4844 commit de6b08f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/ethernet/ethoc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit de6b08f

Please sign in to comment.