Skip to contentSkip to conversation

Remove unnecessary includes of <linux/screen_info.h>

PATCH In review Thomas Zimmermann 3 participants 9 messages Jul 6, 2023 – Jul 7, 2023

Subsystems (9)
lore
Share & tools
lore

Thomas Zimmermann

author maintainer
#0 lore raw

v2 cover Remove unnecessary includes of <linux/screen_info.h>

(was: arch,fbdev: Move screen_info into arch/)

Remove include statements of <linux/screen_info.h> The patches have been reviewed as part of the patchset at [1]. Patch 1 has a fix to make it build on loongarch.

v2:
* update loongarch

[1] https://patchwork.freedesktop.org/series/120010/#rev1

Thomas Zimmermann (4):
efi: Do not include <linux/screen_info.h> from EFI header fbdev/sm712fb: Do not include <linux/screen_info.h>
sysfb: Do not include <linux/screen_info.h> from sysfb header staging/sm750fb: Do not include <linux/screen_info.h>

 arch/arm/kernel/efi.c                         | 2 ++
 arch/arm64/kernel/efi.c                       | 1 +
 arch/loongarch/kernel/efi.c                   | 1 +
 drivers/firmware/efi/libstub/efi-stub-entry.c | 2 ++
 drivers/firmware/efi/libstub/screen_info.c    | 2 ++
 drivers/staging/sm750fb/sm750.c               | 1 -
 drivers/staging/sm750fb/sm750_accel.c         | 1 -
 drivers/staging/sm750fb/sm750_cursor.c        | 1 -
 drivers/staging/sm750fb/sm750_hw.c            | 1 -
 drivers/video/fbdev/sm712fb.c                 | 9 +++++++--
 include/linux/efi.h                           | 3 ++-
 include/linux/sysfb.h                         | 3 ++-
 12 files changed, 19 insertions(+), 8 deletions(-)
Signature · 1 line
2.41.0
author maintainer
#1 lore raw

PATCH v2 1/4 efi: Do not include <linux/screen_info.h> from EFI header

The header file <linux/efi.h> does not need anything from <linux/screen_info.h>. Declare struct screen_info and remove the include statements. Update a number of source files that require struct screen_info's definition.

v2:
* update loongarch (Jingfeng)

---
 arch/arm/kernel/efi.c                         | 2 ++
 arch/arm64/kernel/efi.c                       | 1 +
 arch/loongarch/kernel/efi.c                   | 1 +
 drivers/firmware/efi/libstub/efi-stub-entry.c | 2 ++
 drivers/firmware/efi/libstub/screen_info.c    | 2 ++
 include/linux/efi.h                           | 3 ++-
 6 files changed, 10 insertions(+), 1 deletion(-)
arch/arm/kernel/efi.c +2 -0
index e2b9d2618c67..e94655ef16bb 100644
@@ -5,6 +5,8 @@
 
 #include <linux/efi.h>
 #include <linux/memblock.h>
+#include <linux/screen_info.h>
+
 #include <asm/efi.h>
 #include <asm/mach/map.h>
 #include <asm/mmu_context.h>
arch/arm64/kernel/efi.c +1 -0
index baab8dd3ead3..3afbe503b066 100644
@@ -9,6 +9,7 @@
 
 #include <linux/efi.h>
 #include <linux/init.h>
+#include <linux/screen_info.h>
 
 #include <asm/efi.h>
 #include <asm/stacktrace.h>
arch/loongarch/kernel/efi.c +1 -0
index 3d448fef3af4..9fc10cea21e1 100644
@@ -18,6 +18,7 @@
 #include <linux/kobject.h>
 #include <linux/memblock.h>
 #include <linux/reboot.h>
+#include <linux/screen_info.h>
 #include <linux/uaccess.h>
 
 #include <asm/early_ioremap.h>
drivers/firmware/efi/libstub/efi-stub-entry.c +2 -0
index cc4dcaea67fa..2f1902e5d407 100644
@@ -1,6 +1,8 @@
 // SPDX-License-Identifier: GPL-2.0-only
 
 #include <linux/efi.h>
+#include <linux/screen_info.h>
+
 #include <asm/efi.h>
 
 #include "efistub.h"
drivers/firmware/efi/libstub/screen_info.c +2 -0
index 4be1c4d1f922..a51ec201ca3c 100644
@@ -1,6 +1,8 @@
 // SPDX-License-Identifier: GPL-2.0
 
 #include <linux/efi.h>
+#include <linux/screen_info.h>
+
 #include <asm/efi.h>
 
 #include "efistub.h"
include/linux/efi.h +2 -1
index 571d1a6e1b74..360895a5572c 100644
@@ -24,10 +24,11 @@
 #include <linux/range.h>
 #include <linux/reboot.h>
 #include <linux/uuid.h>
-#include <linux/screen_info.h>
 
 #include <asm/page.h>
 
+struct screen_info;
+
 #define EFI_SUCCESS		0
 #define EFI_LOAD_ERROR		( 1 | (1UL << (BITS_PER_LONG-1)))
 #define EFI_INVALID_PARAMETER	( 2 | (1UL << (BITS_PER_LONG-1)))
Signature · 1 line
2.41.0
Reviewed-by on v2 1/4
#2 lore raw

Re: [PATCH v2 1/4] efi: Do not include <linux/screen_info.h> from EFI header

Quoted 8 lines · Thomas Zimmermann

The header file <linux/efi.h> does not need anything from <linux/screen_info.h>. Declare struct screen_info and remove the include statements. Update a number of source files that require struct screen_info's definition.

v2:
* update loongarch (Jingfeng)

Quoted 7 lines
author maintainer
#3 lore raw

PATCH v2 2/4 fbdev/sm712fb: Do not include <linux/screen_info.h>

In reply to Thomas Zimmermann

Sm712fb's dependency on <linux/screen_info.h> is artificial in that it only uses struct screen_info for its internals. Replace the use of struct screen_info with a custom data structure and remove the include of <linux/screen_info.h>.

---
 drivers/video/fbdev/sm712fb.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/video/fbdev/sm712fb.c +7 -2
index b7ad3c644e13..f929091da4e7 100644
@@ -27,12 +27,17 @@
 #include <linux/uaccess.h>
 #include <linux/module.h>
 #include <linux/console.h>
-#include <linux/screen_info.h>
 
 #include <linux/pm.h>
 
 #include "sm712.h"
 
+struct smtcfb_screen_info {
+	u16 lfb_width;
+	u16 lfb_height;
+	u16 lfb_depth;
+};
+
 /*
  * Private structure
  */
@@ -829,7 +834,7 @@ static const struct modeinit vgamode[] = {
 	},
 };
 
-static struct screen_info smtc_scr_info;
+static struct smtcfb_screen_info smtc_scr_info;
 
 static char *mode_option;
 
Signature · 1 line
2.41.0
Reviewed-by on v2 2/4
#4 lore raw

Re: [PATCH v2 2/4] fbdev/sm712fb: Do not include <linux/screen_info.h>

Quoted 10 lines · Thomas Zimmermann

Sm712fb's dependency on <linux/screen_info.h> is artificial in that it only uses struct screen_info for its internals. Replace the use of struct screen_info with a custom data structure and remove the include of <linux/screen_info.h>.

author maintainer
#5 lore raw

PATCH v2 3/4 sysfb: Do not include <linux/screen_info.h> from sysfb header

In reply to Thomas Zimmermann

The header file <linux/sysfb.h> does not need anything from <linux/screen_info.h>. Declare struct screen_info and remove the include statements.

---
 include/linux/sysfb.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
include/linux/sysfb.h +2 -1
index c1ef5fc60a3c..19cb803dd5ec 100644
@@ -9,7 +9,8 @@
 
 #include <linux/kernel.h>
 #include <linux/platform_data/simplefb.h>
-#include <linux/screen_info.h>
+
+struct screen_info;
 
 enum {
 	M_I17,		/* 17-Inch iMac */
Signature · 1 line
2.41.0
Reviewed-by on v2 3/4
#6 lore raw

Re: [PATCH v2 3/4] sysfb: Do not include <linux/screen_info.h> from sysfb header

Quoted 10 lines · Thomas Zimmermann

The header file <linux/sysfb.h> does not need anything from <linux/screen_info.h>. Declare struct screen_info and remove the include statements.

author maintainer
#7 lore raw

PATCH v2 4/4 staging/sm750fb: Do not include <linux/screen_info.h>

In reply to Thomas Zimmermann

The sm750fb driver does not need anything from <linux/screen_info.h>. Remove the include statements.

---
 drivers/staging/sm750fb/sm750.c        | 1 -
 drivers/staging/sm750fb/sm750_accel.c  | 1 -
 drivers/staging/sm750fb/sm750_cursor.c | 1 -
 drivers/staging/sm750fb/sm750_hw.c     | 1 -
 4 files changed, 4 deletions(-)
drivers/staging/sm750fb/sm750.c +0 -1
index 55e302a27847..c260f73cf570 100644
@@ -14,7 +14,6 @@
 #include <linux/mm_types.h>
 #include <linux/vmalloc.h>
 #include <linux/pagemap.h>
-#include <linux/screen_info.h>
 #include <linux/console.h>
 
 #include "sm750.h"
drivers/staging/sm750fb/sm750_accel.c +0 -1
index 24b9077a634a..44b9e3fe3a41 100644
@@ -14,7 +14,6 @@
 #include <linux/pagemap.h>
 #include <linux/console.h>
 #include <linux/platform_device.h>
-#include <linux/screen_info.h>
 
 #include "sm750.h"
 #include "sm750_accel.h"
drivers/staging/sm750fb/sm750_cursor.c +0 -1
index 43e6f52c2551..eea4d1bd36ce 100644
@@ -14,7 +14,6 @@
 #include <linux/pagemap.h>
 #include <linux/console.h>
 #include <linux/platform_device.h>
-#include <linux/screen_info.h>
 
 #include "sm750.h"
 #include "sm750_cursor.h"
drivers/staging/sm750fb/sm750_hw.c +0 -1
index 55cb00e8b0d1..71247eaf26ee 100644
@@ -17,7 +17,6 @@
 #include <asm/mtrr.h>
 #endif
 #include <linux/platform_device.h>
-#include <linux/screen_info.h>
 #include <linux/sizes.h>
 
 #include "sm750.h"
Signature · 1 line
2.41.0
Reviewed-by Greg Kroah-Hartman on v2 4/4
#8 lore raw

Re: [PATCH v2 4/4] staging/sm750fb: Do not include <linux/screen_info.h>

Quoted 7 lines · Thomas Zimmermann

The sm750fb driver does not need anything from <linux/screen_info.h>. Remove the include statements.

Quoted 7 lines
---
 drivers/staging/sm750fb/sm750.c        | 1 -
 drivers/staging/sm750fb/sm750_accel.c  | 1 -
 drivers/staging/sm750fb/sm750_cursor.c | 1 -
 drivers/staging/sm750fb/sm750_hw.c     | 1 -
 4 files changed, 4 deletions(-)