summaryrefslogtreecommitdiffstats
path: root/board/freescale
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2013-07-14 19:42:40 +0200
committerTom Rini <trini@ti.com>2013-07-15 18:03:15 -0400
commitf4ea9f86d155aa7845f151c7a37699cdc3e4db2b (patch)
tree3fb38b7dc94dde7dfe007d89dc06ae385305c5ae /board/freescale
parent04735e9c5578dd4f3584be5454b9779e8e5c2af9 (diff)
downloadu-boot-f4ea9f86d155aa7845f151c7a37699cdc3e4db2b.tar.gz
u-boot-f4ea9f86d155aa7845f151c7a37699cdc3e4db2b.tar.xz
u-boot-f4ea9f86d155aa7845f151c7a37699cdc3e4db2b.zip
PPC MPC83xx: Fix MPC8323ERDB build warning
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: Timur Tabi <timur@tabi.org> cc: Kim Phillips <kim.phillips@freescale.com>
Diffstat (limited to 'board/freescale')
-rw-r--r--board/freescale/mpc8323erdb/mpc8323erdb.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/board/freescale/mpc8323erdb/mpc8323erdb.c b/board/freescale/mpc8323erdb/mpc8323erdb.c
index f29b2f4f4f..3dce3623a4 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]) {
+ uint32_t crc_buf;
+
+ memcpy(&crc_buf, &buf[24], sizeof(uint32_t));
+
+ 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)) {