[U-Boot] [PATCH] common/board_r: remove warning in initr_mem for 64-bit phys_size_t

Since on powerpc phys_size_t can be unsigned long long, this printout line can result in a not nice compile warning.
Signed-off-by: Valentin Longchamp valentin.longchamp@keymile.com ---
common/board_r.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/common/board_r.c b/common/board_r.c index f9647e1..6c94546 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -664,7 +664,7 @@ int initr_mem(void) /* Also take the logbuffer into account (pram is in kB) */ pram += (LOGBUFF_LEN + LOGBUFF_OVERHEAD) / 1024; # endif - sprintf(memsz, "%ldk", (gd->ram_size / 1024) - pram); + sprintf(memsz, "%ldk", (long int) ((gd->ram_size / 1024) - pram)); setenv("mem", memsz);
return 0;

On 3 October 2014 03:16, Valentin Longchamp valentin.longchamp@keymile.com wrote:
Since on powerpc phys_size_t can be unsigned long long, this printout line can result in a not nice compile warning.
Signed-off-by: Valentin Longchamp valentin.longchamp@keymile.com
Acked-by: Simon Glass sjg@chromium.org
common/board_r.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/common/board_r.c b/common/board_r.c index f9647e1..6c94546 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -664,7 +664,7 @@ int initr_mem(void) /* Also take the logbuffer into account (pram is in kB) */ pram += (LOGBUFF_LEN + LOGBUFF_OVERHEAD) / 1024; # endif
sprintf(memsz, "%ldk", (gd->ram_size / 1024) - pram);
sprintf(memsz, "%ldk", (long int) ((gd->ram_size / 1024) - pram)); setenv("mem", memsz); return 0;
-- 1.8.0.1

On Fri, Oct 03, 2014 at 11:16:19AM +0200, Valentin Longchamp wrote:
Since on powerpc phys_size_t can be unsigned long long, this printout line can result in a not nice compile warning.
Signed-off-by: Valentin Longchamp valentin.longchamp@keymile.com Acked-by: Simon Glass sjg@chromium.org
Applied to u-boot/master, thanks!
participants (3)
-
Simon Glass
-
Tom Rini
-
Valentin Longchamp