Message ID | 20250606-printk-cleanup-part2-v1-7-f427c743dda0@suse.com |
---|---|
State | Not Applicable |
Headers | show |
Series | printk cleanup - part 2 | expand |
On Fri 2025-06-06 23:53:49, Marcos Paulo de Souza wrote: > All consoles found on for_each_console_srcu are registered, meaning that all of > them are already CON_ENABLEDed. > > Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com> > --- > kernel/printk/printk.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c > index 658acf92aa3d2a3d1e294b7e17e5ee96d8169afe..8074a0f73691cfc5f637361048097ace1545c7c0 100644 > --- a/kernel/printk/printk.c > +++ b/kernel/printk/printk.c > @@ -3360,7 +3360,7 @@ void console_unblank(void) > if (flags & CON_SUSPENDED) > continue; > > - if ((flags & CON_ENABLED) && c->unblank) { > + if (c->unblank) { It might actually make sense to check is_console_usable() here. The reason is similar as for the 5th and 6th patch, see https://lore.kernel.org/r/aFAdGas9yGB4zhqc@pathway.suse.cz https://lore.kernel.org/r/aFAiq3IEic8DuATR@pathway.suse.cz > found_unblank = true; > break; > } > @@ -3402,7 +3402,7 @@ void console_unblank(void) > if (flags & CON_SUSPENDED) > continue; > > - if ((flags & CON_ENABLED) && c->unblank) > + if (c->unblank) > c->unblank(); Same here. > } > console_srcu_read_unlock(cookie); > > -- > 2.49.0
Hi Petr, On Mon, 16 Jun 2025 at 17:27, Petr Mladek <pmladek@suse.com> wrote: > On Fri 2025-06-06 23:53:49, Marcos Paulo de Souza wrote: > > All consoles found on for_each_console_srcu are registered, meaning that all of > > them are already CON_ENABLEDed. > > > > Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com> > > --- > > kernel/printk/printk.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c > > index 658acf92aa3d2a3d1e294b7e17e5ee96d8169afe..8074a0f73691cfc5f637361048097ace1545c7c0 100644 > > --- a/kernel/printk/printk.c > > +++ b/kernel/printk/printk.c > > @@ -3360,7 +3360,7 @@ void console_unblank(void) > > if (flags & CON_SUSPENDED) > > continue; > > > > - if ((flags & CON_ENABLED) && c->unblank) { > > + if (c->unblank) { > > It might actually make sense to check is_console_usable() here. My first thought was: one more to convert to a better name! But the actual function is already called console_is_usable() ;-) Gr{oetje,eeting}s, Geert
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index 658acf92aa3d2a3d1e294b7e17e5ee96d8169afe..8074a0f73691cfc5f637361048097ace1545c7c0 100644 --- a/kernel/printk/printk.c +++ b/kernel/printk/printk.c @@ -3360,7 +3360,7 @@ void console_unblank(void) if (flags & CON_SUSPENDED) continue; - if ((flags & CON_ENABLED) && c->unblank) { + if (c->unblank) { found_unblank = true; break; } @@ -3402,7 +3402,7 @@ void console_unblank(void) if (flags & CON_SUSPENDED) continue; - if ((flags & CON_ENABLED) && c->unblank) + if (c->unblank) c->unblank(); } console_srcu_read_unlock(cookie);
All consoles found on for_each_console_srcu are registered, meaning that all of them are already CON_ENABLEDed. Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com> --- kernel/printk/printk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)