Skip to contentSkip to conversation

Fix compile warning in uli526x driver

PATCH New Kumar Gala 1 participant 2 messages Oct 20, 2010 Network drivers

lore
Share & tools
lore

Kumar Gala

author
#0 lore raw

PATCH 1/1 Fix compile warning in uli526x driver

uli526x.c: In function 'uli526x_init_one':
uli526x.c:314:2: warning: dereferencing type-punned pointer will break strict-aliasing rules uli526x.c:314:2: warning: dereferencing type-punned pointer will break strict-aliasing rules

---
 drivers/net/uli526x.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
drivers/net/uli526x.c +3 -2
index 56eee7b..d626d68 100644
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007 Freescale Semiconductor, Inc.
+ * Copyright 2007, 2010 Freescale Semiconductor, Inc.
  *
  * Author: Roy Zang <[email protected]>, Sep, 2007
  *
@@ -311,7 +311,8 @@ static int uli526x_init_one(struct eth_device *dev, bd_t *bis)
 			i));
 
 	/* Set Node address */
-	if (((u16 *) db->srom)[0] == 0xffff || ((u16 *) db->srom)[0] == 0)
+	if (((db->srom[0] == 0xff) && (db->srom[1] == 0xff)) ||
+	    ((db->srom[0] == 0x00) && (db->srom[1] == 0x00)))
 	/* SROM absent, so write MAC address to ID Table */
 		set_mac_addr(dev);
 	else {		/*Exist SROM*/
Signature · 1 line
1.7.2.3
author Applied
#1 lore raw

PATCH 1/1 Fix compile warning in uli526x driver

Quoted 8 lines · Kumar Gala

uli526x.c: In function 'uli526x_init_one':
uli526x.c:314:2: warning: dereferencing type-punned pointer will break strict-aliasing rules uli526x.c:314:2: warning: dereferencing type-punned pointer will break strict-aliasing rules

---
drivers/net/uli526x.c | 5 +++--

1 files changed, 3 insertions(+), 2 deletions(-)

applied to 85xx

- k