From: Tom Rini Date: Wed, 30 Oct 2019 13:18:43 +0000 (-0400) Subject: common/console.c: Fix unused warning with console_doenv() X-Git-Url: http://git.dujemihanovic.xyz/login.html?a=commitdiff_plain;h=5e63c96aa7b4e7fd8758cdc4753eece3a42481e0;p=u-boot.git common/console.c: Fix unused warning with console_doenv() Newer versions of LLVM-7 will provide an unused function warning over console_doenv() in the case of SYS_CONSOLE_IS_IN_ENV not being enabled as can be the case in SPL. Add guards around this function. Signed-off-by: Tom Rini --- diff --git a/common/console.c b/common/console.c index 89b1e9590c..168ba60d0d 100644 --- a/common/console.c +++ b/common/console.c @@ -252,10 +252,12 @@ static void console_puts(int file, const char *s) } } +#if CONFIG_IS_ENABLED(SYS_CONSOLE_IS_IN_ENV) static inline void console_doenv(int file, struct stdio_dev *dev) { iomux_doenv(file, dev->name); } +#endif #else static inline int console_getc(int file) { @@ -283,10 +285,12 @@ static inline void console_puts(int file, const char *s) stdio_devices[file]->puts(stdio_devices[file], s); } +#if CONFIG_IS_ENABLED(SYS_CONSOLE_IS_IN_ENV) static inline void console_doenv(int file, struct stdio_dev *dev) { console_setfile(file, dev); } +#endif #endif /* CONIFIG_IS_ENABLED(CONSOLE_MUX) */ /** U-Boot INITIAL CONSOLE-NOT COMPATIBLE FUNCTIONS *************************/