netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: ethoc: Use ether_addr_copy()
@ 2017-03-17 10:52 Tobias Klauser
  2017-03-20 11:16 ` Thierry Reding
  2017-03-22  0:17 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Tobias Klauser @ 2017-03-17 10:52 UTC (permalink / raw)
  To: netdev; +Cc: f.fainelli, thierry.reding

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>
---
 drivers/net/ethernet/ethoc.c | 4 ++--
 1 file 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;
 	}
 
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net: ethoc: Use ether_addr_copy()
  2017-03-17 10:52 [PATCH net-next] net: ethoc: Use ether_addr_copy() Tobias Klauser
@ 2017-03-20 11:16 ` Thierry Reding
  2017-03-22  0:17 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Thierry Reding @ 2017-03-20 11:16 UTC (permalink / raw)
  To: Tobias Klauser; +Cc: netdev, f.fainelli

[-- Attachment #1: Type: text/plain, Size: 382 bytes --]

On Fri, Mar 17, 2017 at 11:52:15AM +0100, Tobias Klauser wrote:
> 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>
> ---
>  drivers/net/ethernet/ethoc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Thierry Reding <thierry.reding@gmail.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net: ethoc: Use ether_addr_copy()
  2017-03-17 10:52 [PATCH net-next] net: ethoc: Use ether_addr_copy() Tobias Klauser
  2017-03-20 11:16 ` Thierry Reding
@ 2017-03-22  0:17 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2017-03-22  0:17 UTC (permalink / raw)
  To: tklauser; +Cc: netdev, f.fainelli, thierry.reding

From: Tobias Klauser <tklauser@distanz.ch>
Date: Fri, 17 Mar 2017 11:52:15 +0100

> 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>

Applied.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-03-22  0:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-17 10:52 [PATCH net-next] net: ethoc: Use ether_addr_copy() Tobias Klauser
2017-03-20 11:16 ` Thierry Reding
2017-03-22  0:17 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).