Message ID | 1382089644-14595-2-git-send-email-valentin.longchamp@keymile.com |
---|---|
State | Accepted |
Delegated to: | York Sun |
Headers | show |
On 10/18/2013 02:47 AM, Valentin Longchamp wrote: > When exporting the new memsize without reserved PRAM area, the -Wformat > option produces a warning since %ld is used for snprintf and bi_memsize > is phys_size_t. > > This patch removes this warning for all PRAM PowerPC boards. > > Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com> > --- > Changes in v4: None > Changes in v3: None > Changes in v2: None > Applied to 85xx/next, pending merge to 85xx/master. York
diff --git a/arch/powerpc/lib/board.c b/arch/powerpc/lib/board.c index a101e03..34bbfca 100644 --- a/arch/powerpc/lib/board.c +++ b/arch/powerpc/lib/board.c @@ -984,7 +984,7 @@ void board_init_r(gd_t *id, ulong dest_addr) pram += (LOGBUFF_LEN + LOGBUFF_OVERHEAD) / 1024; #endif #endif - sprintf(memsz, "%ldk", (bd->bi_memsize / 1024) - pram); + sprintf(memsz, "%ldk", (ulong) (bd->bi_memsize / 1024) - pram); setenv("mem", memsz); } #endif
When exporting the new memsize without reserved PRAM area, the -Wformat option produces a warning since %ld is used for snprintf and bi_memsize is phys_size_t. This patch removes this warning for all PRAM PowerPC boards. Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com> --- Changes in v4: None Changes in v3: None Changes in v2: None arch/powerpc/lib/board.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)