projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0ed4844
)
net: ethoc: Use ether_addr_copy()
author
Tobias Klauser
<
[email protected]
>
Fri, 17 Mar 2017 10:52:15 +0000
(11:52 +0100)
committer
David S. Miller
<
[email protected]
>
Wed, 22 Mar 2017 00:16:56 +0000
(17:16 -0700)
Use ether_addr_copy() instead of memcpy() to set netdev->dev_addr (which
is 2-byte aligned).
Signed-off-by: Tobias Klauser <
[email protected]
>
Reviewed-by: Thierry Reding <
[email protected]
>
Signed-off-by: David S. Miller <
[email protected]
>
drivers/net/ethernet/ethoc.c
patch
|
blob
|
history
diff --git
a/drivers/net/ethernet/ethoc.c
b/drivers/net/ethernet/ethoc.c
index 23d82748f52b9aa19ecd17226444f3326dfaaed4..e863ba74d005d7f255931b336825df2abadd2fc8 100644
(file)
--- 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;
}