From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?ISO-8859-1?Q?Andreas_Bie=DFmann?= Date: Tue, 23 Oct 2012 14:37:26 +0200 Subject: [U-Boot] [PATCH] common/lcd: fix eldk 4.2 compile warning In-Reply-To: <201210231414.10173.marex@denx.de> References: <1350992711-352-1-git-send-email-andreas.devel@googlemail.com> <201210231414.10173.marex@denx.de> Message-ID: <50868F86.4060405@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 Dear Marek Vasut, On 23.10.2012 14:14, Marek Vasut wrote: > Dear Andreas Bie?mann, > >> This fixes following warning only generated with eldk-4.2: >> >> ---8<--- >> lcd.c: In function 'bitmap_plot': >> lcd.c:527: warning: dereferencing type-punned pointer will break >> strict-aliasing rules --->8--- >> >> Signed-off-by: Andreas Bie?mann >> Cc: Marek Vasut >> --- >> common/lcd.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/common/lcd.c b/common/lcd.c >> index b6be800..9a4435f 100644 >> --- a/common/lcd.c >> +++ b/common/lcd.c >> @@ -524,7 +524,7 @@ static inline ushort *configuration_get_cmap(void) >> void bitmap_plot(int x, int y) >> { >> #ifdef CONFIG_ATMEL_LCD >> - uint *cmap = (uint *)bmp_logo_palette; >> + uint *cmap = (void *)bmp_logo_palette; > > Are you _sure_ this is the right fix ? yes, I am. This patch is runtime tested on an at91sam9263ek. I first tried to consolidate the cmap and just use the ushort as in the else path. But unfortunately this require some more rework of this driver. > Why is the atmel LCD driver so separate > anyway? Sorry, I don't know. This should really be reworked some time. But I think for now this quick fix can be applied to silence your eldk-4.2 warning. Best regards Andreas Bie?mann