Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

console: fix up ARM screen_info reference

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>

authored by

Arnd Bergmann and committed by
Greg Kroah-Hartman
0059bc9a b8466fe8

+5 -3
+1
arch/arm/include/asm/vga.h
··· 5 5 #include <linux/io.h> 6 6 7 7 extern unsigned long vga_base; 8 + extern struct screen_info vgacon_screen_info; 8 9 9 10 #define VGA_MAP_MEM(x,s) (vga_base + (x)) 10 11
+1 -1
arch/arm/kernel/setup.c
··· 929 929 } 930 930 931 931 #if defined(CONFIG_VGA_CONSOLE) 932 - static struct screen_info vgacon_screen_info = { 932 + struct screen_info vgacon_screen_info = { 933 933 .orig_video_lines = 30, 934 934 .orig_video_cols = 80, 935 935 .orig_video_mode = 0,
+3 -2
drivers/video/console/dummycon.c
··· 19 19 */ 20 20 21 21 #if defined(CONFIG_ARCH_FOOTBRIDGE) && defined(CONFIG_VGA_CONSOLE) 22 - #define DUMMY_COLUMNS screen_info.orig_video_cols 23 - #define DUMMY_ROWS screen_info.orig_video_lines 22 + #include <asm/vga.h> 23 + #define DUMMY_COLUMNS vgacon_screen_info.orig_video_cols 24 + #define DUMMY_ROWS vgacon_screen_info.orig_video_lines 24 25 #else 25 26 /* set by Kconfig. Use 80x25 for 640x480 and 160x64 for 1280x1024 */ 26 27 #define DUMMY_COLUMNS CONFIG_DUMMY_CONSOLE_COLUMNS