Thread (4 messages) 4 messages, 2 authors, 2007-02-28

Re: [PATCH 1/2] mv643xx_eth: move mac_addr inside of mv643xx_eth_platform_data

From: Stephen Hemminger <hidden>
Date: 2007-02-28 23:17:42
Also in: lkml, netdev

On Wed, 28 Feb 2007 15:40:31 -0700
"Dale Farnsworth" [off-list ref] wrote:
quoted hunk ↗ jump to hunk
The information contained within platform_data should be self-contained.
Replace the pointer to a MAC address with the actual MAC address in
struct mv643xx_eth_platform_data.

Signed-off-by: Dale Farnsworth <redacted>

Index: b/drivers/net/mv643xx_eth.c
===================================================================
--- a/drivers/net/mv643xx_eth.c
+++ b/drivers/net/mv643xx_eth.c
@@ -1380,7 +1380,9 @@ static int mv643xx_eth_probe(struct plat
 
 	pd = pdev->dev.platform_data;
 	if (pd) {
-		if (pd->mac_addr)
+		static u8 zero_mac_addr[6] = { 0 };
+
+		if (memcmp(pd->mac_addr, zero_mac_addr, 6) != 0)
 			memcpy(dev->dev_addr, pd->mac_addr, 6);

is_zero_ether_addr() is faster/cleaner for this

-- 
Stephen Hemminger [off-list ref]
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help