Skip to contentSkip to conversation

common/console.c: Fix unused warning with console_doenv()

PATCH New Tom Rini 1 participant 2 messages Oct 30, 2019 – Nov 7, 2019

lore
Share & tools
lore

Tom Rini

author
#0 lore raw

PATCH 1/1 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.

---
 common/console.c | 4 ++++
 1 file changed, 4 insertions(+)
common/console.c +4 -0
index 89b1e9590cad..168ba60d0d9e 100644
@@ -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 *************************/
Signature · 1 line
2.17.1
author
#1 lore raw

PATCH 1/1 common/console.c: Fix unused warning with console_doenv()

Quoted 5 lines · Tom Rini

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.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20191107/40bb22c6/attachment.sig>