printk: add dummy printk_force_console_enter/exit helpers
PATCH 1/1 printk: add dummy printk_force_console_enter/exit helpers
From: Arnd Bergmann <[email protected]>
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.
--- include/linux/printk.h | 8 ++++++++ 1 file changed, 8 insertions(+)
include/linux/printk.h +8 -0
@@ -232,6 +232,14 @@ static inline void printk_deferred_exit(void) { } +static void printk_force_console_enter (void ) +{ +} + +static void printk_force_console_exit (void ) +{ +} +static inline int printk_ratelimit (void ) {return 0 ;
Signature · 1 line
2.39.5
PATCH v2 1/1 printk: add dummy printk_force_console_enter/exit helpers
From: Arnd Bergmann <[email protected]>
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.
---
v2: realized I sent the wrong version that was missing 'inline'.
--- include/linux/printk.h | 8 ++++++++ 1 file changed, 8 insertions(+)
include/linux/printk.h +8 -0
@@ -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 ;
Signature · 1 line
2.39.5
Quoted 6 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
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]
Quoted 7 lines
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.
Does it compile with make W=1 without warnings/errors? If so, I am okay with the approach.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 14 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
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(); | ^~~~~~~~~~~~~~~~~~~~~~~~~
Quoted 1 line
Add empty stub functions for both.
Ouch, indeed, my fault. After disabling prinkt I saw the build errors. Thanks for fixing it!
Quoted 28 lines
Fixes ed76c07c6885 ("printk: Introduce FORCE_CON flag")Signed-off-by Arnd Bergmann <[email protected]>---
v2: realized I sent the wrong version that was missing 'inline'.
---
include/linux/printk.h | 8 ++++++++1 file changed, 8 insertions(+)include/linux/printk.h +0
-0@@ -232,6 +232,14 @@ static inline void printk_deferred_exit(void) { }include/linux/printk.h +8
-0+static inline void printk_force_console_enter (void ) +{ +} + +static inline void printk_force_console_exit (void ) +{ +} +static inline int
printk_ratelimit(void)
{
return 0;
Petr Mladek
maintainerQuoted 12 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
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(); | ^~~~~~~~~~~~~~~~~~~~~~~~~
Quoted 4 lines
Add empty stub functions for both.
Fixes ed76c07c6885 ("printk: Introduce FORCE_CON flag")Signed-off-by Arnd Bergmann <[email protected]>
Thanks a lot for the fix!
I have just pushed it into printk/linux.git,
branch for-6.13-force-console.
Best Regards,
Petr