2022-10-19 15:09:18

by John Ogness

[permalink] [raw]
Subject: [PATCH printk v2 08/38] efi: earlycon: use console_is_enabled()

Replace (console->flags & CON_ENABLED) usage with console_is_enabled().

Signed-off-by: John Ogness <[email protected]>
---
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


2022-10-19 16:03:56

by Ard Biesheuvel

[permalink] [raw]
Subject: Re: [PATCH printk v2 08/38] efi: earlycon: use console_is_enabled()

On Wed, 19 Oct 2022 at 16:56, John Ogness <[email protected]> wrote:
>
> Replace (console->flags & CON_ENABLED) usage with console_is_enabled().
>
> Signed-off-by: John Ogness <[email protected]>

Acked-by: Ard BIesheuvel <[email protected]>

> ---
> 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
>

2022-10-21 13:33:35

by Petr Mladek

[permalink] [raw]
Subject: Re: [PATCH printk v2 08/38] efi: earlycon: use console_is_enabled()

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 <[email protected]>

Reviewed-by: Petr Mladek <[email protected]>

Best Regards,
Petr