From: Wolfgang Denk Date: Fri, 8 Mar 2013 19:52:37 +0100 Subject: [U-Boot] [PATCH] 8xx: Fix build warnings Message-ID: <1362768757-11425-1-git-send-email-wd@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de MPC8xx based systems throw this warning: cpu.c:81:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] Fix it. Signed-off-by: Wolfgang Denk Cc: Andy Fleming --- arch/powerpc/cpu/mpc8xx/cpu.c | 4 +++- arch/powerpc/include/asm/8xx_immap.h | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/cpu/mpc8xx/cpu.c b/arch/powerpc/cpu/mpc8xx/cpu.c index b6b733d..f48d602 100644 --- a/arch/powerpc/cpu/mpc8xx/cpu.c +++ b/arch/powerpc/cpu/mpc8xx/cpu.c @@ -78,7 +78,9 @@ 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_dparam[PROFF_REVNUM] << 8 | + immap->im_cpm.cp_dparam[PROFF_REVNUM + 1] ; m = 0; suf = ""; diff --git a/arch/powerpc/include/asm/8xx_immap.h b/arch/powerpc/include/asm/8xx_immap.h index 40679cb..3b29b39 100644 --- a/arch/powerpc/include/asm/8xx_immap.h +++ b/arch/powerpc/include/asm/8xx_immap.h @@ -488,6 +488,11 @@ typedef struct comm_proc { u_char cp_dparam[0x400]; /* Parameter RAM */ } cpm8xx_t; +/* + * Parameter RAM offsets from the base. + */ +#define PROFF_REVNUM ((uint)0x00B0) + /* Internal memory map. */ typedef struct immap { -- 1.7.11.7