summaryrefslogtreecommitdiff
path: root/cmd/bdinfo.c
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2018-10-11 13:15:01 +0200
committerTom Rini <trini@konsulko.com>2018-11-16 13:34:34 -0500
commit95187bb7cbb95c1074ad17ccc3822d83d972210d (patch)
treedff4264d11cacdc0f5d4672ebbca349be5634253 /cmd/bdinfo.c
parent1473f6ac882fde8078826ca828aa3494ff98bf08 (diff)
cmd/bdinfo: correct output of numerical values
Display all digits on 64bit systems. Currently we print only the lower 32 bits. Examples of values that can exceed 32 bits are the size and start of memory banks. For fdt_blob use the same output method as for other values. This avoids misalignment. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Diffstat (limited to 'cmd/bdinfo.c')
-rw-r--r--cmd/bdinfo.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd/bdinfo.c b/cmd/bdinfo.c
index 60b438766d..cbeba6ba28 100644
--- a/cmd/bdinfo.c
+++ b/cmd/bdinfo.c
@@ -16,7 +16,7 @@ DECLARE_GLOBAL_DATA_PTR;
__maybe_unused
static void print_num(const char *name, ulong value)
{
- printf("%-12s= 0x%08lX\n", name, value);
+ printf("%-12s= 0x%0*lx\n", name, 2 * (int)sizeof(value), value);
}
__maybe_unused
@@ -348,7 +348,7 @@ static int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc,
CONFIG_VAL(SYS_MALLOC_F_LEN));
#endif
if (gd->fdt_blob)
- printf("fdt_blob = %p\n", gd->fdt_blob);
+ print_num("fdt_blob", (ulong)gd->fdt_blob);
return 0;
}