Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1370266

[PATCH v3 4/5] net: macb: Use ether_addr_copy over memcpy

From Moritz Fischer <moritz.fischer@ettus.com>
Newsgroups linux.kernel
Subject [PATCH v3 4/5] net: macb: Use ether_addr_copy over memcpy
Date 2016-04-03 19:30 +0200
Message-ID <rjU0z-6OT-27@gated-at.bofh.it> (permalink)
References <rjU0y-6OT-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Checkpatch suggests using ether_addr_copy over memcpy
to copy the mac address.

Acked-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Moritz Fischer <moritz.fischer@ettus.com>
---
 drivers/net/ethernet/cadence/macb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c
index 2ba0934..01a8ffb 100644
--- a/drivers/net/ethernet/cadence/macb.c
+++ b/drivers/net/ethernet/cadence/macb.c
@@ -2973,7 +2973,7 @@ static int macb_probe(struct platform_device *pdev)
 
 	mac = of_get_mac_address(np);
 	if (mac)
-		memcpy(bp->dev->dev_addr, mac, ETH_ALEN);
+		ether_addr_copy(bp->dev->dev_addr, mac);
 	else
 		macb_get_hwaddr(bp);
 
-- 
2.7.4

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v3 0/5] macb: Codingstyle cleanups Moritz Fischer <moritz.fischer@ettus.com> - 2016-04-03 19:30 +0200
  [PATCH v3 2/5] net: macb: Fix coding style warnings Moritz Fischer <moritz.fischer@ettus.com> - 2016-04-03 19:30 +0200
  [PATCH v3 5/5] net: macb: Fix simple typo Moritz Fischer <moritz.fischer@ettus.com> - 2016-04-03 19:30 +0200
  [PATCH v3 1/5] net: macb: Fix coding style error message Moritz Fischer <moritz.fischer@ettus.com> - 2016-04-03 19:30 +0200
  [PATCH v3 3/5] net: macb: Fix coding style suggestions Moritz Fischer <moritz.fischer@ettus.com> - 2016-04-03 19:30 +0200
  [PATCH v3 4/5] net: macb: Use ether_addr_copy over memcpy Moritz Fischer <moritz.fischer@ettus.com> - 2016-04-03 19:30 +0200
  Re: [PATCH v3 0/5] macb: Codingstyle cleanups David Miller <davem@davemloft.net> - 2016-04-04 22:20 +0200

csiph-web