Skip to contentSkip to conversation

PPC 74xx_7xx: Fix build warnings for ELPPC board

PATCH New Wolfgang Denk 1 participant 2 messages Jun 14, 2013 – Jun 27, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 PPC 74xx_7xx: Fix build warnings for ELPPC board

Fix:

misc.c: In function 'misc_init_r':
misc.c:210:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
misc.c:211:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
misc.c:212:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]

---
 board/eltec/elppc/misc.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
board/eltec/elppc/misc.c +8 -3
index 89f1b1d..4c3656e 100644
@@ -207,9 +207,14 @@ int misc_init_r (void)
 		buf[4] = eerev.etheraddr[5];
 		buf[5] = eerev.etheraddr[4];
 
-		*(unsigned short *) &buf[20] = 0x48B2;
-		*(unsigned short *) &buf[22] = 0x0004;
-		*(unsigned short *) &buf[24] = 0x1433;
+		buf[20] = 0x48;
+		buf[21] = 0xB2;
+
+		buf[22] = 0x00;
+		buf[23] = 0x04;
+
+		buf[24] = 0x14;
+		buf[25] = 0x33;
 
 		printf ("\nSRom:  Writing i82559 info ........ ");
 		if (eepro100_srom_store ((unsigned short *) buf) == -1)
Signature · 1 line
1.7.11.7
author Applied
#1 lore raw

PATCH 1/2 PPC 74xx_7xx: Fix build warnings for ELPPC board

Dear Wolfgang Denk,

Quoted 10 lines · In message <[email protected]> you wrote:

Fix:

misc.c: In function 'misc_init_r':
misc.c:210:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
misc.c:211:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
misc.c:212:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]

Quoted 4 lines
---
 board/eltec/elppc/misc.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 8 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
PUBLIC NOTICE AS REQUIRED BY LAW:  Any Use of This  Product,  in  Any
Manner  Whatsoever,  Will  Increase  the  Amount  of  Disorder in the
Universe. Although No Liability Is Implied Herein,  the  Consumer  Is
Warned  That  This  Process Will Ultimately Lead to the Heat Death of
the Universe.