summaryrefslogtreecommitdiff
path: root/kernel/printk/printk.c
diff options
context:
space:
mode:
authorJohn Ogness <john.ogness@linutronix.de>2024-08-20 08:35:44 +0206
committerPetr Mladek <pmladek@suse.com>2024-08-21 14:56:24 +0200
commitfc400d5f63570afdadd718ae962cf5aa0feeace6 (patch)
tree0eefe14fc5dc47810f2b22211be533e56a07fde5 /kernel/printk/printk.c
parent20846d1ce2adacd2b1f8672e24d6acb26b2e757b (diff)
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/printk.c')
-rw-r--r--kernel/printk/printk.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index b9c8fff9a493..ffb56c2150b0 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -3012,9 +3012,10 @@ static bool console_flush_all(bool do_cond_resched, u64 *next_seq, bool *handove
cookie = console_srcu_read_lock();
for_each_console_srcu(con) {
+ short flags = console_srcu_read_flags(con);
bool progress;
- if (!console_is_usable(con))
+ if (!console_is_usable(con, flags))
continue;
any_usable = true;
@@ -3925,7 +3926,7 @@ static bool __pr_flush(struct console *con, int timeout_ms, bool reset_on_progre
* that they make forward progress, so only increment
* @diff for usable consoles.
*/
- if (!console_is_usable(c))
+ if (!console_is_usable(c, flags))
continue;
if (flags & CON_NBCON) {