m68k: Fix warnings with gcc 4.6
authorSimon Glass <sjg@chromium.org>
Sun, 8 Jun 2014 04:07:58 +0000 (22:07 -0600)
committerTom Rini <trini@ti.com>
Wed, 11 Jun 2014 20:27:05 +0000 (16:27 -0400)
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@chromium.org>
arch/m68k/cpu/mcf532x/cpu_init.c
arch/m68k/include/asm/posix_types.h
arch/m68k/lib/bootm.c
board/astro/mcf5373l/fpga.c
board/astro/mcf5373l/mcf5373l.c
drivers/fpga/altera.c
drivers/fpga/xilinx.c

index db7ded4782b5daeb279d517268b739e93b9a0333..8d01f5fcf0d62b7cfbab5b33af87bbf8b9a28a3f 100644 (file)
@@ -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
 
index 4fbc0405f74f094062c3df25bebaaff838fbc821..b97d2674236e6903b1c9df5f284747b66dc616c2 100644 (file)
@@ -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;
index 804e01dae68b8cf606e237351fab7c98f1c9d497..fa9c4930814e470a058419ded5878386c246bd6b 100644 (file)
@@ -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;
index 1d044d96a563ed67f2fe2ff2da2e2a0f4425fb2a..d1110dfd6e7b7b63c958d605832b6f59abc27c54 100644 (file)
@@ -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;
index daba32c9dc1acd74be9fa348738783cb8564e613..7ec7cb378f561fc936a8821715e15db1c35ddcc0 100644 (file)
@@ -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);
 }
 
index af189f4ef4c580f9231a95b07ff76cbccfa23904..6e34a8e56e9c1191514901727e92c05b3c0d94e1 100644 (file)
@@ -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);
index 3795c1aff6e267640c4ef869c0e344c52e3b9f93..adb4b8cd25fdcce540f9d73c1aee49a920c09e7a 100644 (file)
@@ -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);