common/lcd: fix eldk 4.2 compile warning
PATCH 1/1 common/lcd: fix eldk 4.2 compile warning
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---
--- common/lcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
common/lcd.c +1 -1
@@ -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;#else ushort *cmap = (ushort *)bmp_logo_palette;#endif
Signature · 1 line
1.7.10.4
PATCH 1/1 common/lcd: fix eldk 4.2 compile warning
Dear Andreas Bie?mann,
Quoted 18 lines
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 <[email protected]>Cc Marek Vasut <[email protected]>--- common/lcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)common/lcd.c +0
-0
common/lcd.c static inline ushort *configuration_get_cmap(void) · line 527
Quoted 5 lines
common/lcd.c +1
-1@@ -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 ? Why is the atmel LCD driver so separate anyway?
Thanks!
common/lcd.c static inline ushort *configuration_get_cmap(void) · line 530
Quoted 3 lines
common/lcd.c +0
-0#else ushort *cmap = (ushort *)bmp_logo_palette;#endif
Best regards,
Marek Vasut
PATCH 1/1 common/lcd: fix eldk 4.2 compile warning
Dear Marek Vasut,
Quoted 15 lines · Marek Vasut
Dear Andreas Bie?mann,
Quoted 13 lines
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 <[email protected]>Cc Marek Vasut <[email protected]>--- common/lcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 12 lines
common/lcd.c static inline ushort *configuration_get_cmap(void) · line 527
Quoted 10 lines
common/lcd.c +1
-1@@ -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.
Quoted 2 lines
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
PATCH 1/1 common/lcd: fix eldk 4.2 compile warning
Dear Andreas Bie?mann,
[..]
Quoted 5 lines
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.
Can you do such rework? You're the atmel guy afterall.
Quoted 6 lines
Quoted 2 lines
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.
I don't like hiding problems, can we aim for a proper solution please?
[...]
Best regards,
Marek Vasut
PATCH 1/1 common/lcd: fix eldk 4.2 compile warning
Dear Marek Vasut,
Quoted 10 lines · Marek Vasut
Dear Andreas Bie?mann,
[..]
Quoted 5 lines
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.
Can you do such rework? You're the atmel guy afterall.
I can do such rework, although I have currently not much time to work on that issue. Until 2013.01 release in January this should be doable but not in the next few days until MW closes.
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
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.
I don't like hiding problems, can we aim for a proper solution please?
You are right, we should do so.
Best regards
Andreas Bie?mann