From d39041fcadb1231430201d298c31f6be03d654f7 Mon Sep 17 00:00:00 2001 From: Wolfgang Denk Date: Sun, 19 Jul 2009 01:15:52 +0200 Subject: PATI board: fix compiler warnings 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 --- board/mpl/common/flash.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'board/mpl/common') diff --git a/board/mpl/common/flash.c b/board/mpl/common/flash.c index 302d7a3d50c..355608cd3bd 100644 --- a/board/mpl/common/flash.c +++ b/board/mpl/common/flash.c @@ -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) { -- cgit v1.2.3