public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 2/2] PPC MPC83xx: Fix MPC8323ERDB build warning
@ 2013-06-14  8:21 Wolfgang Denk
  2013-06-14  9:14 ` Wolfgang Denk
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Wolfgang Denk @ 2013-06-14  8:21 UTC (permalink / raw)
  To: u-boot

Fix:

mpc8323erdb.c: In function 'mac_read_from_eeprom':
mpc8323erdb.c:198:3: warning: dereferencing type-punned pointer will
break strict-aliasing rules [-Wstrict-aliasing]

Signed-off-by: Wolfgang Denk <wd@denx.de>
cc: Michael Barkowski <michael.barkowski@freescale.com>
cc: Kim Phillips <kim.phillips@freescale.com>
---
 board/freescale/mpc8323erdb/mpc8323erdb.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/board/freescale/mpc8323erdb/mpc8323erdb.c b/board/freescale/mpc8323erdb/mpc8323erdb.c
index f29b2f4..533cb08 100644
--- a/board/freescale/mpc8323erdb/mpc8323erdb.c
+++ b/board/freescale/mpc8323erdb/mpc8323erdb.c
@@ -195,7 +195,11 @@ int mac_read_from_eeprom(void)
 		printf("\nEEPROM @ 0x%02x read FAILED!!!\n",
 		       CONFIG_SYS_I2C_EEPROM_ADDR);
 	} else {
-		if (crc32(crc, buf, 24) == *(unsigned int *)&buf[24]) {
+		unsigned int crc_buf;
+
+		memcpy(&crc_buf, &buf[24], sizeof(unsigned int));
+
+		if (crc32(crc, buf, 24) == crc_buf) {
 			printf("Reading MAC from EEPROM\n");
 			for (i = 0; i < 4; i++) {
 				if (memcmp(&buf[i * 6], "\0\0\0\0\0\0", 6)) {
-- 
1.7.11.7

^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2013-07-16 14:36 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-14  8:21 [U-Boot] [PATCH 2/2] PPC MPC83xx: Fix MPC8323ERDB build warning Wolfgang Denk
2013-06-14  9:14 ` Wolfgang Denk
2013-06-28 21:47   ` Andy Fleming
2013-06-29  4:11     ` Timur Tabi
2013-06-29  6:04       ` Sinan Akman
2013-07-04  6:15       ` Wolfgang Denk
2013-06-27  6:22 ` Wolfgang Denk
2013-07-04 12:57 ` Timur Tabi
2013-07-08 18:19   ` [U-Boot] [PATCH 2/2 V2] " Wolfgang Denk
2013-07-08 22:04     ` Timur Tabi
2013-07-14 17:44       ` Wolfgang Denk
2013-07-08 18:23   ` Wolfgang Denk
2013-07-14 17:42   ` [U-Boot] [PATCH 2/2 V3] " Wolfgang Denk
2013-07-14 22:24     ` Timur Tabi
2013-07-16 14:36     ` [U-Boot] [U-Boot, 2/2, " Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox