diff mbox series

[10/17] display_options: Use USE_TINY_PRINTF for SPL check

Message ID 20210114032957.483086-11-sjg@chromium.org
State Accepted
Commit ac42fe539ca991543c888e261e62b4187ec9bbee
Delegated to: Tom Rini
Headers show
Series Various minor clean-ups and improvements | expand

Commit Message

Simon Glass Jan. 14, 2021, 3:29 a.m. UTC
At present this code uses a simple printf() format if running in SPL. But
SPL can use the full printf. Use USE_TINY_PRINTF instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 lib/display_options.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

Comments

Tom Rini Jan. 28, 2021, 11:58 p.m. UTC | #1
On Wed, Jan 13, 2021 at 08:29:50PM -0700, Simon Glass wrote:

> At present this code uses a simple printf() format if running in SPL. But
> SPL can use the full printf. Use USE_TINY_PRINTF instead.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/lib/display_options.c b/lib/display_options.c
index b2025eeb5cf..cd48998b6d4 100644
--- a/lib/display_options.c
+++ b/lib/display_options.c
@@ -169,11 +169,10 @@  int print_buffer(ulong addr, const void *data, uint width, uint count,
 				x = lb.us[i] = *(volatile uint16_t *)data;
 			else
 				x = lb.uc[i] = *(volatile uint8_t *)data;
-#if defined(CONFIG_SPL_BUILD)
-			printf(" %x", (uint)x);
-#else
-			printf(" %0*lx", width * 2, x);
-#endif
+			if (CONFIG_IS_ENABLED(USE_TINY_PRINTF))
+				printf(" %x", (uint)x);
+			else
+				printf(" %0*lx", width * 2, x);
 			data += width;
 		}