[printk,v2,08/38] efi: earlycon: use console_is_enabled()

Message ID 20221019145600.1282823-9-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/firmware/efi/earlycon.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Ard Biesheuvel Oct. 19, 2022, 3:32 p.m. UTC | #1
On Wed, 19 Oct 2022 at 16:56, John Ogness <john.ogness@linutronix.de> wrote:
>
> Replace (console->flags & CON_ENABLED) usage with console_is_enabled().
>
> Signed-off-by: John Ogness <john.ogness@linutronix.de>

Acked-by: Ard BIesheuvel <ardb@kernel.org>

> ---
>  drivers/firmware/efi/earlycon.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/firmware/efi/earlycon.c b/drivers/firmware/efi/earlycon.c
> index a52236e11e5f..8c27eb941d8e 100644
> --- a/drivers/firmware/efi/earlycon.c
> +++ b/drivers/firmware/efi/earlycon.c
> @@ -30,7 +30,7 @@ static void *efi_fb;
>  static int __init efi_earlycon_remap_fb(void)
>  {
>         /* bail if there is no bootconsole or it has been disabled already */
> -       if (!earlycon_console || !(earlycon_console->flags & CON_ENABLED))
> +       if (!earlycon_console || !console_is_enabled(earlycon_console))
>                 return 0;
>
>         efi_fb = memremap(fb_base, screen_info.lfb_size,
> @@ -43,7 +43,7 @@ early_initcall(efi_earlycon_remap_fb);
>  static int __init efi_earlycon_unmap_fb(void)
>  {
>         /* unmap the bootconsole fb unless keep_bootcon has left it enabled */
> -       if (efi_fb && !(earlycon_console->flags & CON_ENABLED))
> +       if (efi_fb && !console_is_enabled(earlycon_console))
>                 memunmap(efi_fb);
>         return 0;
>  }
> --
> 2.30.2
>
  
Petr Mladek Oct. 21, 2022, 12:53 p.m. UTC | #2
On Wed 2022-10-19 17:01:30, 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/firmware/efi/earlycon.c b/drivers/firmware/efi/earlycon.c
index a52236e11e5f..8c27eb941d8e 100644
--- a/drivers/firmware/efi/earlycon.c
+++ b/drivers/firmware/efi/earlycon.c
@@ -30,7 +30,7 @@  static void *efi_fb;
 static int __init efi_earlycon_remap_fb(void)
 {
 	/* bail if there is no bootconsole or it has been disabled already */
-	if (!earlycon_console || !(earlycon_console->flags & CON_ENABLED))
+	if (!earlycon_console || !console_is_enabled(earlycon_console))
 		return 0;
 
 	efi_fb = memremap(fb_base, screen_info.lfb_size,
@@ -43,7 +43,7 @@  early_initcall(efi_earlycon_remap_fb);
 static int __init efi_earlycon_unmap_fb(void)
 {
 	/* unmap the bootconsole fb unless keep_bootcon has left it enabled */
-	if (efi_fb && !(earlycon_console->flags & CON_ENABLED))
+	if (efi_fb && !console_is_enabled(earlycon_console))
 		memunmap(efi_fb);
 	return 0;
 }