diff options
author | John Ogness <john.ogness@linutronix.de> | 2024-08-20 08:35:44 +0206 |
---|---|---|
committer | Petr Mladek <pmladek@suse.com> | 2024-08-21 14:56:24 +0200 |
commit | fc400d5f63570afdadd718ae962cf5aa0feeace6 (patch) | |
tree | 0eefe14fc5dc47810f2b22211be533e56a07fde5 /kernel/printk/internal.h | |
parent | 20846d1ce2adacd2b1f8672e24d6acb26b2e757b (diff) | |
download | linux-fc400d5f63570afdadd718ae962cf5aa0feeace6.tar.gz linux-fc400d5f63570afdadd718ae962cf5aa0feeace6.tar.bz2 linux-fc400d5f63570afdadd718ae962cf5aa0feeace6.zip |
printk: Add @flags argument for console_is_usable()
The caller of console_is_usable() usually needs @console->flags
for its own checks. Rather than having console_is_usable() read
its own copy, make the caller pass in the @flags. This also
ensures that the caller saw the same @flags value.
Signed-off-by: John Ogness <john.ogness@linutronix.de>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Link: https://lore.kernel.org/r/20240820063001.36405-19-john.ogness@linutronix.de
Signed-off-by: Petr Mladek <pmladek@suse.com>
Diffstat (limited to 'kernel/printk/internal.h')
-rw-r--r-- | kernel/printk/internal.h | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/kernel/printk/internal.h b/kernel/printk/internal.h index 448a5fcd5228..fe8d84d78f1c 100644 --- a/kernel/printk/internal.h +++ b/kernel/printk/internal.h @@ -89,13 +89,9 @@ void nbcon_free(struct console *con); * records. Note that this function does not consider the current context, * which can also play a role in deciding if @con can be used to print * records. - * - * Requires the console_srcu_read_lock. */ -static inline bool console_is_usable(struct console *con) +static inline bool console_is_usable(struct console *con, short flags) { - short flags = console_srcu_read_flags(con); - if (!(flags & CON_ENABLED)) return false; @@ -141,7 +137,7 @@ static inline void nbcon_seq_force(struct console *con, u64 seq) { } static inline bool nbcon_alloc(struct console *con) { return false; } static inline void nbcon_free(struct console *con) { } -static inline bool console_is_usable(struct console *con) { return false; } +static inline bool console_is_usable(struct console *con, short flags) { return false; } #endif /* CONFIG_PRINTK */ |