]> git.sur5r.net Git - u-boot/commitdiff
cam5200_niosflash: fix build warnings
authorWolfgang Denk <wd@denx.de>
Wed, 24 Nov 2010 21:27:08 +0000 (22:27 +0100)
committerWolfgang Denk <wd@denx.de>
Fri, 26 Nov 2010 21:08:18 +0000 (22:08 +0100)
Fix warnings:

cam5200_flash.c: In function 'write_word_32':
cam5200_flash.c:443: warning: dereferencing type-punned pointer will break strict-aliasing rules
cam5200_flash.c: In function 'write_word_16':
cam5200_flash.c:684: warning: dereferencing type-punned pointer will break strict-aliasing rules

Signed-off-by: Wolfgang Denk <wd@denx.de>
Acked-by: Stefan Roese <sr@denx.de>
board/tqc/tqm5200/cam5200_flash.c

index 124b47d22848d9c2b08b133a85c8d77b39831147..4c8922f35f5c69a5203ab0c67487db2a7ab93034 100644 (file)
@@ -440,7 +440,9 @@ static int write_word(flash_info_t * info, ulong dest, ulong data)
 {
        volatile CONFIG_SYS_FLASH_WORD_SIZE *addr2 = (CONFIG_SYS_FLASH_WORD_SIZE *) (info->start[0]);
        volatile CONFIG_SYS_FLASH_WORD_SIZE *dest2 = (CONFIG_SYS_FLASH_WORD_SIZE *) dest;
-       volatile CONFIG_SYS_FLASH_WORD_SIZE *data2 = (CONFIG_SYS_FLASH_WORD_SIZE *) & data;
+       ulong *datap = &data;
+       volatile CONFIG_SYS_FLASH_WORD_SIZE *data2 =
+                       (volatile CONFIG_SYS_FLASH_WORD_SIZE *)datap;
        ulong start;
        int i, flag;
 
@@ -681,7 +683,9 @@ static int write_word_16(flash_info_t * info, ulong dest, ulong data)
 {
        volatile CONFIG_SYS_FLASH_WORD_SIZE *addr2 = (CONFIG_SYS_FLASH_WORD_SIZE *) (info->start[0]);
        volatile CONFIG_SYS_FLASH_WORD_SIZE *dest2 = (CONFIG_SYS_FLASH_WORD_SIZE *) dest;
-       volatile CONFIG_SYS_FLASH_WORD_SIZE *data2 = (CONFIG_SYS_FLASH_WORD_SIZE *) & data;
+       ulong *datap = &data;
+       volatile CONFIG_SYS_FLASH_WORD_SIZE *data2 =
+                       (volatile CONFIG_SYS_FLASH_WORD_SIZE *)datap;
        ulong start;
        int i;