From a166fbca20e40937bf37cc18c389f68e995c1821 Mon Sep 17 00:00:00 2001 From: Scott Wood Date: Fri, 17 May 2013 20:01:54 -0500 Subject: 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 Acked-by: Wolfgang Denk --- common/cmd_immap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'common/cmd_immap.c') diff --git a/common/cmd_immap.c b/common/cmd_immap.c index fdf9489b2e..bb15795e22 100644 --- a/common/cmd_immap.c +++ b/common/cmd_immap.c @@ -535,7 +535,7 @@ do_i2cinfo (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) volatile iic_t *iip; uint dpaddr; - dpaddr = *((unsigned short *) (&immap->im_dprambase[PROFF_I2C_BASE])); + dpaddr = immap->im_dprambase16[PROFF_I2C_BASE / sizeof(u16)]; if (dpaddr == 0) iip = NULL; else -- cgit v1.2.3