Re: [PATCH 2/4] vgacon: rework screen_info #ifdef checks

From
Javier Martinez Canillas <javierm@redhat.com>
Date
2023-07-07 13:41:41
Also in
dri-devel, linux-alpha, linux-fbdev, linux-mips, linux-riscv, lkml, loongarch
Reply to
Arnd Bergmann, 2023-07-07
Arnd Bergmann [off-list ref] writes:
From: Arnd Bergmann <arnd@arndb.de>

On non-x86 architectures, the screen_info variable is generally only
used for the VGA console where supported, and in some cases the EFI
framebuffer or vga16fb.

Now that we have a definite list of which architectures actually use it
for what, use consistent #ifdef checks so the global variable is only
defined when it is actually used on those architectures.

On powerpc, there is no support for vgacon, but there is support for
vga16fb. Loongarch and riscv have no support for vgacon or vga16fb, but
they support EFI firmware, so only that needs to be checked, and the
initialization can be removed because that is handled by EFI.
IA64 has both vgacon and EFI.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
[...]
quoted hunk ↗ jump to hunk
diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c
index 5a55ac82c13a4..0c09ff7fde46b 100644
--- a/arch/ia64/kernel/setup.c
+++ b/arch/ia64/kernel/setup.c
@@ -86,9 +86,11 @@ EXPORT_SYMBOL(local_per_cpu_offset);
 #endif
 unsigned long ia64_cycles_per_usec;
 struct ia64_boot_param *ia64_boot_param;
+#if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_EFI)
 struct screen_info screen_info;
I think that only screen_info should be guarded by both symbols ?
 unsigned long vga_console_iobase;
It seems this variable was never used since it was introduced by commit
66b7f8a30437 ("[IA64-SGI] pcdp: add PCDP pci interface support") ?
 unsigned long vga_console_membase;
And this is only used by mdacon (not supported by ia64), vgacon and
vga16fb (not supported by ia64 either).

So this could just be guarded just by CONFIG_VGA_CONSOLE for ia64 ?

The rest of the patch looks good to me.

Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat
Thread (6 messages) 6 messages, 5 authors, last reply 2023-07-27
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help