From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Mon, 26 Sep 2011 11:32:43 +0200 Subject: [U-Boot] [PATCH] GCC4.4: Squash multiple warnings due to strict aliasing In-Reply-To: <4E80455B.4040602@ge.com> References: <1317002798-27112-1-git-send-email-marek.vasut@gmail.com> <4E80455B.4040602@ge.com> Message-ID: <201109261132.43616.marek.vasut@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Monday, September 26, 2011 11:26:51 AM Nick Thompson wrote: > On 26/09/11 03:06, Marek Vasut wrote: > > Signed-off-by: Marek Vasut > > --- > > > > arch/arm/include/asm/io.h | 30 ++++++++++++++++++------------ > > 1 files changed, 18 insertions(+), 12 deletions(-) > > > > diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h > > index 1fbc531..61f4987 100644 > > --- a/arch/arm/include/asm/io.h > > +++ b/arch/arm/include/asm/io.h > > @@ -78,43 +78,49 @@ static inline phys_addr_t virt_to_phys(void * vaddr) > > > > extern inline void __raw_writesb(unsigned int addr, const void *data, > > int bytelen) { > > > > uint8_t *buf = (uint8_t *)data; > > > > - while(bytelen--) > > - __arch_putb(*buf++, addr); > > + int i; > > + for (i = 0; i < bytelen; i++) > > + __arch_putb(buf[i], addr); > > > > } > > This fixes the problem in these use cases, but leaves the door open. > > Would it be better to change the __arch_putb macro into an extern inline > function instead which would catch these and future cases? Yes, but you'll need to do that on a much larger scale. Is anyone up for doing it ? > > Nick.