[U-Boot] [PATCH] spl: don't use %#l with CONFIG_USE_TINY_PRINTF

Oded Gabbay oded.gabbay at gmail.com
Wed Dec 28 09:12:16 CET 2016


In the tiny-printf implementation, there is no support for %# and/or %l. This
patch checks if CONFIG_USE_TINY_PRINTF is defined and if so, prints a
different debug statement which doesn't use %#l

Signed-off-by: Oded Gabbay <oded.gabbay at gmail.com>
Cc: Simon Glass <sjg at chromium.org>
---
 common/spl/spl.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/common/spl/spl.c b/common/spl/spl.c
index f7df834..23dfa2d 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -385,9 +385,14 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
 		debug("Unsupported OS image.. Jumping nevertheless..\n");
 	}
 #if defined(CONFIG_SYS_MALLOC_F_LEN) && !defined(CONFIG_SYS_SPL_MALLOC_SIZE)
+#ifdef CONFIG_USE_TINY_PRINTF
+	debug("SPL malloc() used 0x%x bytes (%d KB)\n",
+		(uint) gd->malloc_ptr, (uint) gd->malloc_ptr / 1024);
+#else
 	debug("SPL malloc() used %#lx bytes (%ld KB)\n", gd->malloc_ptr,
 	      gd->malloc_ptr / 1024);
 #endif
+#endif
 
 	debug("loaded - jumping to U-Boot...");
 	spl_board_prepare_for_boot();
-- 
2.7.4



More information about the U-Boot mailing list