linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@kernel.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-fbdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, loongarch@lists.linux.dev,
	linux-arm-kernel@lists.infradead.org,
	Javier Martinez Canillas <javierm@redhat.com>,
	Ard Biesheuvel <ardb@kernel.org>, Helge Deller <deller@gmx.de>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	Arnd Bergmann <arnd@arndb.de>
Subject: [PATCH 2/2] console: fix up ARM screen_info reference
Date: Tue, 17 Oct 2023 11:39:47 +0200	[thread overview]
Message-ID: <20231017093947.3627976-2-arnd@kernel.org> (raw)
In-Reply-To: <20231017093947.3627976-1-arnd@kernel.org>

From: Arnd Bergmann <arnd@arndb.de>

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>
---
Greg, this was caused by patch "vgacon: clean up global screen_info
instances" in tty-testing. You can either apply this patch on top or fold
it into that, or I can just resend the fixed series if you prefer.
---
 arch/arm/include/asm/vga.h       | 1 +
 arch/arm/kernel/setup.c          | 2 +-
 drivers/video/console/dummycon.c | 5 +++--
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/arch/arm/include/asm/vga.h b/arch/arm/include/asm/vga.h
index 7c0bee57855ab..6c430ec371df2 100644
--- a/arch/arm/include/asm/vga.h
+++ b/arch/arm/include/asm/vga.h
@@ -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))
 
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index b808712e85981..ff2299ce1ad7a 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -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,
diff --git a/drivers/video/console/dummycon.c b/drivers/video/console/dummycon.c
index 70549fecee12c..14af5d9e13b00 100644
--- a/drivers/video/console/dummycon.c
+++ b/drivers/video/console/dummycon.c
@@ -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
-- 
2.39.2


      reply	other threads:[~2023-10-17  9:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-17  9:39 [PATCH 1/2] [v2] efi: move screen_info into efi init code Arnd Bergmann
2023-10-17  9:39 ` Arnd Bergmann [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231017093947.3627976-2-arnd@kernel.org \
    --to=arnd@kernel.org \
    --cc=ardb@kernel.org \
    --cc=arnd@arndb.de \
    --cc=deller@gmx.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=javierm@redhat.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=loongarch@lists.linux.dev \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).