]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
powerpc: cast bi_memsize to ulong for %ld usage
authorValentin Longchamp <valentin.longchamp@keymile.com>
Fri, 18 Oct 2013 09:47:14 +0000 (11:47 +0200)
committerYork Sun <yorksun@freescale.com>
Thu, 24 Oct 2013 16:35:15 +0000 (09:35 -0700)
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>
arch/powerpc/lib/board.c

index a101e036019c6bca271a55d8f553b75afb4a2f51..34bbfca5544d8d5bde5bff3be5ebc64f275dddfa 100644 (file)
@@ -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