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.czechow...@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

Reply via email to