Patchwork [U-Boot,1/2] PPC 74xx_7xx: Fix build warnings for ELPPC board

login
register
mail settings
Submitter Wolfgang Denk
Date June 14, 2013, 8:20 a.m.
Message ID <1371198044-3456-1-git-send-email-wd@denx.de>
Download mbox | patch
Permalink /patch/251260/
State Accepted
Delegated to: Wolfgang Denk
Headers show

Comments

Wolfgang Denk - June 14, 2013, 8:20 a.m.
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]

Signed-off-by: Wolfgang Denk <wd@denx.de>
---
 board/eltec/elppc/misc.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
Wolfgang Denk - June 27, 2013, 6:20 a.m.
Dear Wolfgang Denk,

In message <1371198044-3456-1-git-send-email-wd@denx.de> 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]
> 
> Signed-off-by: Wolfgang Denk <wd@denx.de>
> ---
>  board/eltec/elppc/misc.c | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Patch

diff --git a/board/eltec/elppc/misc.c b/board/eltec/elppc/misc.c
index 89f1b1d..4c3656e 100644
--- a/board/eltec/elppc/misc.c
+++ b/board/eltec/elppc/misc.c
@@ -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)