]> git.sur5r.net Git - u-boot/commitdiff
PATI board: fix compiler warnings
authorWolfgang Denk <wd@denx.de>
Sat, 18 Jul 2009 23:15:52 +0000 (01:15 +0200)
committerWolfgang Denk <wd@denx.de>
Sat, 18 Jul 2009 23:15:52 +0000 (01:15 +0200)
Fix these:
pati.c: In function 'checkboard':
pati.c:358: warning: pointer targets in passing argument 2 of 'getenv_r' differ in signedness
../common/flash.c: In function 'write_word':
../common/flash.c:824: warning: dereferencing type-punned pointer will break strict-aliasing rules
cmd_pati.c: In function 'do_pati':
cmd_pati.c:279: warning: 'value' may be used uninitialized in this function

Signed-off-by: Wolfgang Denk <wd@denx.de>
board/mpl/common/flash.c
board/mpl/pati/cmd_pati.c
board/mpl/pati/pati.c

index 302d7a3d50ce4e9f666b8c475190b8c00887caa0..355608cd3bdfd1d09d23ad3c3edd3b46b74a6c2f 100644 (file)
@@ -819,13 +819,17 @@ static FLASH_WORD_SIZE *read_val = (FLASH_WORD_SIZE *)0x200000;
 
 static int write_word (flash_info_t *info, ulong dest, ulong data)
 {
-       volatile FLASH_WORD_SIZE *addr2 = (FLASH_WORD_SIZE *)(info->start[0]);
-       volatile FLASH_WORD_SIZE *dest2 = (FLASH_WORD_SIZE *)dest;
-       volatile FLASH_WORD_SIZE *data2 = (FLASH_WORD_SIZE *)&data;
+       volatile FLASH_WORD_SIZE *addr2 = (volatile FLASH_WORD_SIZE *)(info->start[0]);
+       volatile FLASH_WORD_SIZE *dest2 = (volatile FLASH_WORD_SIZE *)dest;
+       volatile FLASH_WORD_SIZE *data2;
        ulong start;
+       ulong *data_p;
        int flag;
        int i;
 
+       data_p = &data;
+       data2 = (volatile FLASH_WORD_SIZE *)data_p;
+
        /* Check if Flash is (sufficiently) erased */
        if ((*((volatile FLASH_WORD_SIZE *)dest) &
                (FLASH_WORD_SIZE)data) != (FLASH_WORD_SIZE)data) {
index 0682323ae1f0c1eb323770794fe9f6d435bb38d9..740881e6d4078789d3f9903075733f7b492843b0 100644 (file)
@@ -276,7 +276,7 @@ static int pati_pci_eeprom_write(unsigned short offset, unsigned long addr, unsi
 static int pati_pci_eeprom_read(unsigned short offset, unsigned long addr, unsigned short size)
 {
        int i;
-       unsigned short value;
+       unsigned short value = 0;
        unsigned short *buffer =(unsigned short *)addr;
        if((offset + size) > PATI_EEPROM_LAST_OFFSET) {
                size = PATI_EEPROM_LAST_OFFSET - offset;
index 8f23d2dc0e355bea65b6bbe06a33fe6a581ee135..1b3b698ed90f776cbc44090c5079c04ae8aa5430 100644 (file)
@@ -347,8 +347,8 @@ int last_stage_init (void)
 
 int checkboard (void)
 {
-       unsigned char s[50];
-       unsigned long reg;
+       char s[50];
+       ulong reg;
        char rev;
        int i;