[printk,v2,17/38] tty: tty_io: use console_is_enabled()

Message ID 20221019145600.1282823-18-john.ogness@linutronix.de
State New
Headers
Series reduce console_lock scope |

Commit Message

John Ogness Oct. 19, 2022, 2:55 p.m. UTC
  Replace (console->flags & CON_ENABLED) usage with console_is_enabled().

Signed-off-by: John Ogness <john.ogness@linutronix.de>
---
 drivers/tty/tty_io.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Greg KH Oct. 19, 2022, 4 p.m. UTC | #1
On Wed, Oct 19, 2022 at 05:01:39PM +0206, John Ogness wrote:
> Replace (console->flags & CON_ENABLED) usage with console_is_enabled().
> 
> Signed-off-by: John Ogness <john.ogness@linutronix.de>
> ---
>  drivers/tty/tty_io.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  
Petr Mladek Oct. 21, 2022, 2:24 p.m. UTC | #2
On Wed 2022-10-19 17:01:39, John Ogness wrote:
> Replace (console->flags & CON_ENABLED) usage with console_is_enabled().
> 
> Signed-off-by: John Ogness <john.ogness@linutronix.de>

Reviewed-by: Petr Mladek <pmladek@suse.com>

Best Regards,
Petr
  

Patch

diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index de06c3c2ff70..2050e63963bb 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -3532,7 +3532,7 @@  static ssize_t show_cons_active(struct device *dev,
 			continue;
 		if (!c->write)
 			continue;
-		if ((c->flags & CON_ENABLED) == 0)
+		if (!console_is_enabled(c))
 			continue;
 		cs[i++] = c;
 		if (i >= ARRAY_SIZE(cs))