printk: Use console_is_usable on console_unblank
The macro for_each_console_srcu iterates over all registered consoles. It's implied that all registered consoles have CON_ENABLED flag set, making the check for the flag unnecessary. Call console_is_usable function to fully verify if the given console is usable before calling the ->unblank callback. Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com> Reviewed-by: Petr Mladek <pmladek@suse.com> Link: https://patch.msgid.link/20251121-printk-cleanup-part2-v2-3-57b8b78647f4@suse.com Signed-off-by: Petr Mladek <pmladek@suse.com>
This commit is contained in:
parent
4c70ab110b
commit
466348abb0
|
|
@ -3331,12 +3331,10 @@ void console_unblank(void)
|
|||
*/
|
||||
cookie = console_srcu_read_lock();
|
||||
for_each_console_srcu(c) {
|
||||
short flags = console_srcu_read_flags(c);
|
||||
|
||||
if (flags & CON_SUSPENDED)
|
||||
if (!console_is_usable(c, console_srcu_read_flags(c), true))
|
||||
continue;
|
||||
|
||||
if ((flags & CON_ENABLED) && c->unblank) {
|
||||
if (c->unblank) {
|
||||
found_unblank = true;
|
||||
break;
|
||||
}
|
||||
|
|
@ -3373,12 +3371,10 @@ void console_unblank(void)
|
|||
|
||||
cookie = console_srcu_read_lock();
|
||||
for_each_console_srcu(c) {
|
||||
short flags = console_srcu_read_flags(c);
|
||||
|
||||
if (flags & CON_SUSPENDED)
|
||||
if (!console_is_usable(c, console_srcu_read_flags(c), true))
|
||||
continue;
|
||||
|
||||
if ((flags & CON_ENABLED) && c->unblank)
|
||||
if (c->unblank)
|
||||
c->unblank();
|
||||
}
|
||||
console_srcu_read_unlock(cookie);
|
||||
|
|
|
|||
Loading…
Reference in New Issue