From 66dc09c5540be61345ae6bcd797149065baf5340 Mon Sep 17 00:00:00 2001
From: =?utf8?q?Lothar=20Wa=C3=9Fmann?= <LW@KARO-electronics.de>
Date: Mon, 10 Jul 2017 08:44:24 +0200
Subject: [PATCH] cmd, nand: fix broken output of "nand info"
MIME-Version: 1.0
Content-Type: text/plain; charset=utf8
Content-Transfer-Encoding: 8bit

If the value of either "nand options" or "bbt options" has a zero in
the most significant nibble, the '0x' prefix will be isolated from the
value like shown below:
|Device 0: nand0, sector size 128 KiB
|  Page size       2048 b
|  OOB size          64 b
|  Erase size    131072 b
|  subpagesize     2048 b
|  options     0x40000200
|  bbt options 0x   60000

Change the format string to produce leading zeroes filling the gap.

Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
---
 cmd/nand.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cmd/nand.c b/cmd/nand.c
index c16ec77ed4..72ca88a943 100644
--- a/cmd/nand.c
+++ b/cmd/nand.c
@@ -295,8 +295,8 @@ static void nand_print_and_set_info(int idx)
 	printf("  OOB size    %8d b\n", mtd->oobsize);
 	printf("  Erase size  %8d b\n", mtd->erasesize);
 	printf("  subpagesize %8d b\n", chip->subpagesize);
-	printf("  options     0x%8x\n", chip->options);
-	printf("  bbt options 0x%8x\n", chip->bbt_options);
+	printf("  options     0x%08x\n", chip->options);
+	printf("  bbt options 0x%08x\n", chip->bbt_options);
 
 	/* Set geometry info */
 	setenv_hex("nand_writesize", mtd->writesize);
-- 
2.39.5