Re: [PATCH printk v1 11/18] printk: nobkl: Introduce printer threads

From: John Ogness
Date: Fri Mar 03 2023 - 05:58:58 EST


On 2023-03-03, kernel test robot <lkp@xxxxxxxxx> wrote:
> kernel/printk/printk.c: In function 'console_flush_all':
>>> kernel/printk/printk.c:2979:30: error: implicit declaration of function 'console_is_usable'; did you mean 'console_exit_unsafe'? [-Werror=implicit-function-declaration]
> 2979 | if (!console_is_usable(con, flags))
> | ^~~~~~~~~~~~~~~~~
> | console_exit_unsafe

This macro needs to be defined for !CONFIG_PRINTK as well.

diff --git a/kernel/printk/internal.h b/kernel/printk/internal.h
index 60d6bf18247e..e4fb600daf06 100644
--- a/kernel/printk/internal.h
+++ b/kernel/printk/internal.h
@@ -147,6 +147,7 @@ static inline void cons_kthread_create(struct console *con) { }
static inline bool printk_percpu_data_ready(void) { return false; }
static inline bool cons_nobkl_init(struct console *con) { return true; }
static inline void cons_nobkl_cleanup(struct console *con) { }
+static inline bool console_is_usable(struct console *con, short flags) { return false; }

#endif /* CONFIG_PRINTK */