]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
console: fix up ARM screen_info reference
authorArnd Bergmann <arnd@arndb.de>
Tue, 17 Oct 2023 09:39:47 +0000 (11:39 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 17 Oct 2023 14:34:02 +0000 (16:34 +0200)
Separating the VGA console screen_info from the EFI one unfortunately
caused a build failure for footbridge that I had never caught
with randconfig builds:

arch/arm/kernel/setup.c:932:27: error: static declaration of 'vgacon_screen_info' follows non-static declaration
  932 | static struct screen_info vgacon_screen_info = {
      |                           ^~~~~~~~~~~~~~~~~~
In file included from arch/arm/kernel/setup.c:44:
arch/arm/include/asm/setup.h:40:27: note: previous declaration of 'vgacon_screen_info' with type 'struct screen_info'
   40 | extern struct screen_info vgacon_screen_info;
      |                           ^~~~~~~~~~~~~~~~~~
arm-linux-gnueabi-ld: drivers/video/console/dummycon.o: in function `dummycon_init':
dummycon.c:(.text+0xe4): undefined reference to `screen_info'

Make sure the variable is global to avoid the conflict with the extern
declaration, and make it work in dummycon.c

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20231017093947.3627976-2-arnd@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm/include/asm/vga.h
arch/arm/kernel/setup.c
drivers/video/console/dummycon.c

index 7c0bee57855ab6ac71d954eb8bdda6e028536d07..6c430ec371df2e19ba27e07624384bd23066ffa5 100644 (file)
@@ -5,6 +5,7 @@
 #include <linux/io.h>
 
 extern unsigned long vga_base;
+extern struct screen_info vgacon_screen_info;
 
 #define VGA_MAP_MEM(x,s)       (vga_base + (x))
 
index 135b7eff03f722afe5b384594959880dfc4f752b..1623ae1aec45ef9b080d93efbceb3afdde3af7ed 100644 (file)
@@ -929,7 +929,7 @@ static void __init request_standard_resources(const struct machine_desc *mdesc)
 }
 
 #if defined(CONFIG_VGA_CONSOLE)
-static struct screen_info vgacon_screen_info = {
+struct screen_info vgacon_screen_info = {
  .orig_video_lines     = 30,
  .orig_video_cols      = 80,
  .orig_video_mode      = 0,
index 70549fecee12ceccf39c8e5cc23be3890a61cef7..14af5d9e13b00efd153c03f4f4553f52a6a01080 100644 (file)
@@ -19,8 +19,9 @@
  */
 
 #if defined(CONFIG_ARCH_FOOTBRIDGE) && defined(CONFIG_VGA_CONSOLE)
-#define DUMMY_COLUMNS  screen_info.orig_video_cols
-#define DUMMY_ROWS     screen_info.orig_video_lines
+#include <asm/vga.h>
+#define DUMMY_COLUMNS  vgacon_screen_info.orig_video_cols
+#define DUMMY_ROWS     vgacon_screen_info.orig_video_lines
 #else
 /* set by Kconfig. Use 80x25 for 640x480 and 160x64 for 1280x1024 */
 #define DUMMY_COLUMNS  CONFIG_DUMMY_CONSOLE_COLUMNS