[U-Boot] [PATCH] m68k: Fix warnings with gcc 4.6
Simon Glass
sjg at chromium.org
Sun Jun 8 06:07:58 CEST 2014
Most of the warnings seem to be related to using 'int' for size_t. Change
this and fix up the remaining warnings and problems. For bootm, the warning
was masked by others, and there is an actual bug in the code.
Signed-off-by: Simon Glass <sjg at chromium.org>
---
arch/m68k/cpu/mcf532x/cpu_init.c | 2 +-
arch/m68k/include/asm/posix_types.h | 2 +-
arch/m68k/lib/bootm.c | 7 ++-----
board/astro/mcf5373l/fpga.c | 2 +-
board/astro/mcf5373l/mcf5373l.c | 2 +-
drivers/fpga/altera.c | 6 +++---
drivers/fpga/xilinx.c | 6 +++---
7 files changed, 12 insertions(+), 15 deletions(-)
diff --git a/arch/m68k/cpu/mcf532x/cpu_init.c b/arch/m68k/cpu/mcf532x/cpu_init.c
index db7ded4..8d01f5f 100644
--- a/arch/m68k/cpu/mcf532x/cpu_init.c
+++ b/arch/m68k/cpu/mcf532x/cpu_init.c
@@ -208,10 +208,10 @@ void cpu_init_f(void)
scm2_t *scm2 = (scm2_t *) MMAP_SCM2;
gpio_t *gpio = (gpio_t *) MMAP_GPIO;
fbcs_t *fbcs = (fbcs_t *) MMAP_FBCS;
+#ifndef CONFIG_WATCHDOG
wdog_t *wdog = (wdog_t *) MMAP_WDOG;
/* watchdog is enabled by default - disable the watchdog */
-#ifndef CONFIG_WATCHDOG
out_be16(&wdog->cr, 0);
#endif
diff --git a/arch/m68k/include/asm/posix_types.h b/arch/m68k/include/asm/posix_types.h
index 4fbc040..b97d267 100644
--- a/arch/m68k/include/asm/posix_types.h
+++ b/arch/m68k/include/asm/posix_types.h
@@ -15,7 +15,7 @@ typedef long __kernel_off_t;
typedef int __kernel_pid_t;
typedef unsigned int __kernel_uid_t;
typedef unsigned int __kernel_gid_t;
-typedef unsigned int __kernel_size_t;
+typedef unsigned long __kernel_size_t;
typedef int __kernel_ssize_t;
typedef long __kernel_ptrdiff_t;
typedef long __kernel_time_t;
diff --git a/arch/m68k/lib/bootm.c b/arch/m68k/lib/bootm.c
index 804e01d..fa9c493 100644
--- a/arch/m68k/lib/bootm.c
+++ b/arch/m68k/lib/bootm.c
@@ -50,11 +50,7 @@ void arch_lmb_reserve(struct lmb *lmb)
int do_bootm_linux(int flag, int argc, char * const argv[], bootm_headers_t *images)
{
- ulong rd_len;
- ulong initrd_start, initrd_end;
int ret;
-
- ulong cmd_start, cmd_end;
bd_t *kbd;
void (*kernel) (bd_t *, ulong, ulong, ulong, ulong);
struct lmb *lmb = &images->lmb;
@@ -96,7 +92,8 @@ int do_bootm_linux(int flag, int argc, char * const argv[], bootm_headers_t *ima
* sp+16: Start of command line string
* sp+20: End of command line string
*/
- (*kernel) (kbd, initrd_start, initrd_end, cmd_start, cmd_end);
+ (*kernel)(kbd, images->initrd_start, images->initrd_end,
+ images->cmdline_start, images->cmdline_end);
/* does not return */
error:
return 1;
diff --git a/board/astro/mcf5373l/fpga.c b/board/astro/mcf5373l/fpga.c
index 1d044d9..d1110df 100644
--- a/board/astro/mcf5373l/fpga.c
+++ b/board/astro/mcf5373l/fpga.c
@@ -100,7 +100,7 @@ int altera_done_fn(int cookie)
* writing the complete buffer in one function is much faster,
* then calling it for every bit
*/
-int altera_write_fn(void *buf, size_t len, int flush, int cookie)
+int altera_write_fn(const void *buf, size_t len, int flush, int cookie)
{
size_t bytecount = 0;
gpio_t *gpiop = (gpio_t *)MMAP_GPIO;
diff --git a/board/astro/mcf5373l/mcf5373l.c b/board/astro/mcf5373l/mcf5373l.c
index daba32c..7ec7cb3 100644
--- a/board/astro/mcf5373l/mcf5373l.c
+++ b/board/astro/mcf5373l/mcf5373l.c
@@ -79,7 +79,7 @@ phys_size_t initdram(int board_type)
* (Do not rely on the SDCS register(s) being set to 0x00000000
* during reset as stated in the data sheet.)
*/
- return get_ram_size((unsigned long *)CONFIG_SYS_SDRAM_BASE,
+ return get_ram_size((long *)CONFIG_SYS_SDRAM_BASE,
0x80000000 - CONFIG_SYS_SDRAM_BASE);
}
diff --git a/drivers/fpga/altera.c b/drivers/fpga/altera.c
index af189f4..6e34a8e 100644
--- a/drivers/fpga/altera.c
+++ b/drivers/fpga/altera.c
@@ -153,9 +153,9 @@ int altera_info( Altera_desc *desc )
printf ("Unsupported interface type, %d\n", desc->iface);
}
- printf ("Device Size: \t%d bytes\n"
- "Cookie: \t0x%x (%d)\n",
- desc->size, desc->cookie, desc->cookie);
+ printf("Device Size: \t%zd bytes\n"
+ "Cookie: \t0x%x (%d)\n",
+ desc->size, desc->cookie, desc->cookie);
if (desc->iface_fns) {
printf ("Device Function Table @ 0x%p\n", desc->iface_fns);
diff --git a/drivers/fpga/xilinx.c b/drivers/fpga/xilinx.c
index 3795c1a..adb4b8c 100644
--- a/drivers/fpga/xilinx.c
+++ b/drivers/fpga/xilinx.c
@@ -220,9 +220,9 @@ int xilinx_info(xilinx_desc *desc)
printf ("Unsupported interface type, %d\n", desc->iface);
}
- printf ("Device Size: \t%d bytes\n"
- "Cookie: \t0x%x (%d)\n",
- desc->size, desc->cookie, desc->cookie);
+ printf("Device Size: \t%zd bytes\n"
+ "Cookie: \t0x%x (%d)\n",
+ desc->size, desc->cookie, desc->cookie);
if (desc->name)
printf("Device name: \t%s\n", desc->name);
--
2.0.0.526.g5318336
More information about the U-Boot
mailing list