diff options
author | Scott Wood <scottwood@freescale.com> | 2013-05-17 20:01:54 -0500 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2013-06-11 22:01:45 +0200 |
commit | a166fbca20e40937bf37cc18c389f68e995c1821 (patch) | |
tree | ca90c9999014f7172aefabf257c9c0d2533aecf4 /arch/powerpc/cpu/mpc8xx | |
parent | e1208c2fe5e07f9a248cfbf9bbb212aa34ad2806 (diff) | |
download | u-boot-imx-a166fbca20e40937bf37cc18c389f68e995c1821.zip u-boot-imx-a166fbca20e40937bf37cc18c389f68e995c1821.tar.gz u-boot-imx-a166fbca20e40937bf37cc18c389f68e995c1821.tar.bz2 |
powerpc: fix 8xx and 82xx type-punning warnings with GCC 4.7
C99's strict aliasing rules are insane to use in low-level code such as a
bootloader, but as Wolfgang has rejected -fno-strict-aliasing in the
past, add a union so that 16-bit accesses can be performed.
Compile-tested only.
Signed-off-by: Scott Wood <scottwood@freescale.com>
Acked-by: Wolfgang Denk <wd@denx.de>
Diffstat (limited to 'arch/powerpc/cpu/mpc8xx')
-rw-r--r-- | arch/powerpc/cpu/mpc8xx/cpu.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/arch/powerpc/cpu/mpc8xx/cpu.c b/arch/powerpc/cpu/mpc8xx/cpu.c index b6b733d..dc33eb3 100644 --- a/arch/powerpc/cpu/mpc8xx/cpu.c +++ b/arch/powerpc/cpu/mpc8xx/cpu.c @@ -78,7 +78,8 @@ static int check_CPU (long clock, uint pvr, uint immr) if ((pvr >> 16) != 0x0050) return -1; - k = (immr << 16) | *((ushort *) & immap->im_cpm.cp_dparam[0xB0]); + k = (immr << 16) | + immap->im_cpm.cp_dparam16[PROFF_REVNUM / sizeof(u16)]; m = 0; suf = ""; @@ -194,7 +195,8 @@ static int check_CPU (long clock, uint pvr, uint immr) if ((pvr >> 16) != 0x0050) return -1; - k = (immr << 16) | *((ushort *) & immap->im_cpm.cp_dparam[0xB0]); + k = (immr << 16) | + immap->im_cpm.cp_dparam16[PROFF_REVNUM / sizeof(u16)]; m = 0; switch (k) { @@ -253,7 +255,8 @@ static int check_CPU (long clock, uint pvr, uint immr) if ((pvr >> 16) != 0x0050) return -1; - k = (immr << 16) | in_be16((ushort *)&immap->im_cpm.cp_dparam[0xB0]); + k = (immr << 16) | + in_be16(&immap->im_cpm.cp_dparam16[PROFF_REVNUM / sizeof(u16)]); m = 0; switch (k) { @@ -312,7 +315,8 @@ static int check_CPU (long clock, uint pvr, uint immr) if ((pvr >> 16) != 0x0050) return -1; - k = (immr << 16) | *((ushort *) & immap->im_cpm.cp_dparam[0xB0]); + k = (immr << 16) | + immap->im_cpm.cp_dparam16[PROFF_REVNUM / sizeof(u16)]; m = 0; switch (k) { |