Skip to content

Commit ddc9437

Browse files
sjg20trini
authored andcommitted
m68k: Fix warnings with gcc 4.6
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 <[email protected]>
1 parent 34e4a2e commit ddc9437

File tree

7 files changed

+12
-15
lines changed

7 files changed

+12
-15
lines changed

arch/m68k/cpu/mcf532x/cpu_init.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,10 @@ void cpu_init_f(void)
208208
scm2_t *scm2 = (scm2_t *) MMAP_SCM2;
209209
gpio_t *gpio = (gpio_t *) MMAP_GPIO;
210210
fbcs_t *fbcs = (fbcs_t *) MMAP_FBCS;
211+
#ifndef CONFIG_WATCHDOG
211212
wdog_t *wdog = (wdog_t *) MMAP_WDOG;
212213

213214
/* watchdog is enabled by default - disable the watchdog */
214-
#ifndef CONFIG_WATCHDOG
215215
out_be16(&wdog->cr, 0);
216216
#endif
217217

arch/m68k/include/asm/posix_types.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ typedef long __kernel_off_t;
1515
typedef int __kernel_pid_t;
1616
typedef unsigned int __kernel_uid_t;
1717
typedef unsigned int __kernel_gid_t;
18-
typedef unsigned int __kernel_size_t;
18+
typedef unsigned long __kernel_size_t;
1919
typedef int __kernel_ssize_t;
2020
typedef long __kernel_ptrdiff_t;
2121
typedef long __kernel_time_t;

arch/m68k/lib/bootm.c

+2-5
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,7 @@ void arch_lmb_reserve(struct lmb *lmb)
5050

5151
int do_bootm_linux(int flag, int argc, char * const argv[], bootm_headers_t *images)
5252
{
53-
ulong rd_len;
54-
ulong initrd_start, initrd_end;
5553
int ret;
56-
57-
ulong cmd_start, cmd_end;
5854
bd_t *kbd;
5955
void (*kernel) (bd_t *, ulong, ulong, ulong, ulong);
6056
struct lmb *lmb = &images->lmb;
@@ -96,7 +92,8 @@ int do_bootm_linux(int flag, int argc, char * const argv[], bootm_headers_t *ima
9692
* sp+16: Start of command line string
9793
* sp+20: End of command line string
9894
*/
99-
(*kernel) (kbd, initrd_start, initrd_end, cmd_start, cmd_end);
95+
(*kernel)(kbd, images->initrd_start, images->initrd_end,
96+
images->cmdline_start, images->cmdline_end);
10097
/* does not return */
10198
error:
10299
return 1;

board/astro/mcf5373l/fpga.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ int altera_done_fn(int cookie)
100100
* writing the complete buffer in one function is much faster,
101101
* then calling it for every bit
102102
*/
103-
int altera_write_fn(void *buf, size_t len, int flush, int cookie)
103+
int altera_write_fn(const void *buf, size_t len, int flush, int cookie)
104104
{
105105
size_t bytecount = 0;
106106
gpio_t *gpiop = (gpio_t *)MMAP_GPIO;

board/astro/mcf5373l/mcf5373l.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ phys_size_t initdram(int board_type)
7979
* (Do not rely on the SDCS register(s) being set to 0x00000000
8080
* during reset as stated in the data sheet.)
8181
*/
82-
return get_ram_size((unsigned long *)CONFIG_SYS_SDRAM_BASE,
82+
return get_ram_size((long *)CONFIG_SYS_SDRAM_BASE,
8383
0x80000000 - CONFIG_SYS_SDRAM_BASE);
8484
}
8585

drivers/fpga/altera.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,9 @@ int altera_info( Altera_desc *desc )
153153
printf ("Unsupported interface type, %d\n", desc->iface);
154154
}
155155

156-
printf ("Device Size: \t%d bytes\n"
157-
"Cookie: \t0x%x (%d)\n",
158-
desc->size, desc->cookie, desc->cookie);
156+
printf("Device Size: \t%zd bytes\n"
157+
"Cookie: \t0x%x (%d)\n",
158+
desc->size, desc->cookie, desc->cookie);
159159

160160
if (desc->iface_fns) {
161161
printf ("Device Function Table @ 0x%p\n", desc->iface_fns);

drivers/fpga/xilinx.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,9 @@ int xilinx_info(xilinx_desc *desc)
220220
printf ("Unsupported interface type, %d\n", desc->iface);
221221
}
222222

223-
printf ("Device Size: \t%d bytes\n"
224-
"Cookie: \t0x%x (%d)\n",
225-
desc->size, desc->cookie, desc->cookie);
223+
printf("Device Size: \t%zd bytes\n"
224+
"Cookie: \t0x%x (%d)\n",
225+
desc->size, desc->cookie, desc->cookie);
226226
if (desc->name)
227227
printf("Device name: \t%s\n", desc->name);
228228

0 commit comments

Comments
 (0)