[PATCH] [v2] printk: add dummy printk_force_console_enter/exit helpers
From: Arnd Bergmann
Date: Tue Nov 12 2024 - 09:32:32 EST
From: Arnd Bergmann <arnd@xxxxxxxx>
The newly added interface is broken when PRINTK is disabled:
drivers/tty/sysrq.c: In function '__handle_sysrq':
drivers/tty/sysrq.c:601:9: error: implicit declaration of function 'printk_force_console_enter' [-Wimplicit-function-declaration]
601 | printk_force_console_enter();
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/tty/sysrq.c:611:25: error: implicit declaration of function 'printk_force_console_exit' [-Wimplicit-function-declaration]
611 | printk_force_console_exit();
| ^~~~~~~~~~~~~~~~~~~~~~~~~
Add empty stub functions for both.
Fixes: ed76c07c6885 ("printk: Introduce FORCE_CON flag")
Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
---
v2: realized I sent the wrong version that was missing 'inline'.
---
include/linux/printk.h | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/include/linux/printk.h b/include/linux/printk.h
index 232e5fd06701..4217a9f412b2 100644
--- a/include/linux/printk.h
+++ b/include/linux/printk.h
@@ -232,6 +232,14 @@ static inline void printk_deferred_exit(void)
{
}
+static inline void printk_force_console_enter(void)
+{
+}
+
+static inline void printk_force_console_exit(void)
+{
+}
+
static inline int printk_ratelimit(void)
{
return 0;
--
2.39.5