Skip to contentSkip to conversation

cmd/bdinfo: correct output of numerical values

PATCH New Heinrich Schuchardt 2 participants 2 messages Oct 11, 2018 – Nov 17, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 cmd/bdinfo.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
cmd/bdinfo.c +2 -2
index 60b438766d..cbeba6ba28 100644
@@ -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;
 }
Signature · 1 line
2.19.1
#1 lore raw

PATCH 1/1 cmd/bdinfo: correct output of numerical values

Quoted 8 lines · Heinrich Schuchardt

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.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181117/833a0656/attachment.sig>