[PATCH v4 1/5] efi: stub: Define debug uart functions only if CONFIG_DEBUG_UART is enabled

Lukasz Czechowski lukasz.czechowski at thaumatec.com
Thu May 15 17:55:44 CEST 2025


Initialize the debug uart only in case CONFIG_DEBUG_UART is
enabled. The _debug_uart_putc is used internally by debug uart
functions, so it must be also included inside #ifdef block,
otherwise it will cause compilation warnings.

Signed-off-by: Lukasz Czechowski <lukasz.czechowski at thaumatec.com>
---
 lib/efi/efi_stub.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/efi/efi_stub.c b/lib/efi/efi_stub.c
index 40fc29d9adf7..5172cd78a7c0 100644
--- a/lib/efi/efi_stub.c
+++ b/lib/efi/efi_stub.c
@@ -83,12 +83,14 @@ void puts(const char *str)
 		putc(*str++);
 }
 
+#ifdef CONFIG_DEBUG_UART
 static void _debug_uart_putc(int ch)
 {
 	putc(ch);
 }
 
 DEBUG_UART_FUNCS
+#endif
 
 void *memcpy(void *dest, const void *src, size_t size)
 {

-- 
2.43.0



More information about the U-Boot mailing list