Thomas Zimmermann
2024-Feb-13 08:42 UTC
[PATCH v2 0/8] fbdev: Clean up include dependencies in header
Remove unnecessary dependencies in the include statements of the header file <linux/fb.h>. Several files throughout the kernel include the fbdev header, so reducing dependencies positively affects other subsystems as well. Also fix up nouveau and fbtft, which need backlight.h in some their source files. v2: * include backlight.h in fbtft (kernel test robot) Thomas Zimmermann (8): drm/nouveau: Include <linux/backlight.h> staging/fbtft: Include <linux/backlight.h> fbdev: Do not include <linux/backlight.h> in header fbdev: Do not include <linux/fs.h> in header fbdev: Do not include <linux/notifier.h> in header fbdev: Do not include <linux/slab.h> in header fbdev: Clean up forward declarations in header file fbdev: Clean up include statements in header file drivers/gpu/drm/nouveau/dispnv50/disp.c | 1 + drivers/staging/fbtft/fb_ssd1351.c | 2 ++ include/linux/fb.h | 24 +++++++++++++----------- 3 files changed, 16 insertions(+), 11 deletions(-) -- 2.43.0
Thomas Zimmermann
2024-Feb-13 08:42 UTC
[PATCH v2 1/8] drm/nouveau: Include <linux/backlight.h>
Resolved the proxy include via <linux/fb.h>, which does not require the backlight header. Signed-off-by: Thomas Zimmermann <tzimmermann at suse.de> Reviewed-by: Jani Nikula <jani.nikula at intel.com> --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c index 8d37a694b7724..0c3d88ad0b0ea 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/disp.c +++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c @@ -28,6 +28,7 @@ #include "wndw.h" #include "handles.h" +#include <linux/backlight.h> #include <linux/dma-mapping.h> #include <linux/hdmi.h> #include <linux/component.h> -- 2.43.0
Thomas Zimmermann
2024-Feb-13 08:42 UTC
[PATCH v2 2/8] staging/fbtft: Include <linux/backlight.h>
Resolved the proxy include via <linux/fb.h>, which does not require the backlight header. Signed-off-by: Thomas Zimmermann <tzimmermann at suse.de> --- drivers/staging/fbtft/fb_ssd1351.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/fbtft/fb_ssd1351.c b/drivers/staging/fbtft/fb_ssd1351.c index b8d55aa8c5c75..72172e870007e 100644 --- a/drivers/staging/fbtft/fb_ssd1351.c +++ b/drivers/staging/fbtft/fb_ssd1351.c @@ -1,4 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 + +#include <linux/backlight.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/init.h> -- 2.43.0
Thomas Zimmermann
2024-Feb-13 08:42 UTC
[PATCH v2 3/8] fbdev: Do not include <linux/backlight.h> in header
Forward declare struct backlight_device and remove the include statement. Signed-off-by: Thomas Zimmermann <tzimmermann at suse.de> Reviewed-by: Jani Nikula <jani.nikula at intel.com> --- include/linux/fb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/fb.h b/include/linux/fb.h index 2ce2f5c2fca9a..7380d959c5d53 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -13,11 +13,11 @@ #include <linux/workqueue.h> #include <linux/notifier.h> #include <linux/list.h> -#include <linux/backlight.h> #include <linux/slab.h> #include <asm/fb.h> +struct backlight_device; struct vm_area_struct; struct fb_info; struct device; -- 2.43.0
Thomas Zimmermann
2024-Feb-13 08:42 UTC
[PATCH v2 4/8] fbdev: Do not include <linux/fs.h> in header
Forward declare struct inode and remove the include statement. Signed-off-by: Thomas Zimmermann <tzimmermann at suse.de> Reviewed-by: Jani Nikula <jani.nikula at intel.com> --- include/linux/fb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/fb.h b/include/linux/fb.h index 7380d959c5d53..f269ba5202809 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -8,7 +8,6 @@ #define FBIO_CURSOR _IOWR('F', 0x08, struct fb_cursor_user) -#include <linux/fs.h> #include <linux/init.h> #include <linux/workqueue.h> #include <linux/notifier.h> @@ -22,6 +21,7 @@ struct vm_area_struct; struct fb_info; struct device; struct file; +struct inode; struct videomode; struct device_node; -- 2.43.0
Thomas Zimmermann
2024-Feb-13 08:42 UTC
[PATCH v2 5/8] fbdev: Do not include <linux/notifier.h> in header
Forward declare struct notifier_block and remove the include statement. Signed-off-by: Thomas Zimmermann <tzimmermann at suse.de> Reviewed-by: Jani Nikula <jani.nikula at intel.com> --- include/linux/fb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/fb.h b/include/linux/fb.h index f269ba5202809..90f348f14a490 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -10,7 +10,6 @@ #include <linux/init.h> #include <linux/workqueue.h> -#include <linux/notifier.h> #include <linux/list.h> #include <linux/slab.h> @@ -22,6 +21,7 @@ struct fb_info; struct device; struct file; struct inode; +struct notifier_block; struct videomode; struct device_node; -- 2.43.0
Thomas Zimmermann
2024-Feb-13 08:42 UTC
[PATCH v2 6/8] fbdev: Do not include <linux/slab.h> in header
Forward declare struct page and remove the include statement. Signed-off-by: Thomas Zimmermann <tzimmermann at suse.de> Reviewed-by: Jani Nikula <jani.nikula at intel.com> --- include/linux/fb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/fb.h b/include/linux/fb.h index 90f348f14a490..42155898374b1 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -11,7 +11,6 @@ #include <linux/init.h> #include <linux/workqueue.h> #include <linux/list.h> -#include <linux/slab.h> #include <asm/fb.h> @@ -22,6 +21,7 @@ struct device; struct file; struct inode; struct notifier_block; +struct page; struct videomode; struct device_node; -- 2.43.0
Thomas Zimmermann
2024-Feb-13 08:42 UTC
[PATCH v2 7/8] fbdev: Clean up forward declarations in header file
Add forward declarations for struct i2c_adapter and struct module, and sort the list alphabetically. Signed-off-by: Thomas Zimmermann <tzimmermann at suse.de> Reviewed-by: Jani Nikula <jani.nikula at intel.com> --- include/linux/fb.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/include/linux/fb.h b/include/linux/fb.h index 42155898374b1..8f70ca727a30d 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -15,15 +15,17 @@ #include <asm/fb.h> struct backlight_device; -struct vm_area_struct; -struct fb_info; struct device; +struct device_node; +struct fb_info; struct file; +struct i2c_adapter; struct inode; +struct module; struct notifier_block; struct page; struct videomode; -struct device_node; +struct vm_area_struct; /* Definitions below are used in the parsed monitor specs */ #define FB_DPMS_ACTIVE_OFF 1 -- 2.43.0
Thomas Zimmermann
2024-Feb-13 08:42 UTC
[PATCH v2 8/8] fbdev: Clean up include statements in header file
Include mutex.h, printk.h and types.h, remove several unnecessary include statements, and sort the list alphabetically. Signed-off-by: Thomas Zimmermann <tzimmermann at suse.de> Reviewed-by: Jani Nikula <jani.nikula at intel.com> --- include/linux/fb.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/linux/fb.h b/include/linux/fb.h index 8f70ca727a30d..708e6a177b1be 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -2,15 +2,15 @@ #ifndef _LINUX_FB_H #define _LINUX_FB_H -#include <linux/refcount.h> -#include <linux/kgdb.h> #include <uapi/linux/fb.h> #define FBIO_CURSOR _IOWR('F', 0x08, struct fb_cursor_user) -#include <linux/init.h> +#include <linux/mutex.h> +#include <linux/printk.h> +#include <linux/refcount.h> +#include <linux/types.h> #include <linux/workqueue.h> -#include <linux/list.h> #include <asm/fb.h> -- 2.43.0
Thomas Zimmermann
2024-Feb-19 09:31 UTC
[PATCH v2 0/8] fbdev: Clean up include dependencies in header
A-b'd by Helge via email Acked-by: Helge Deller <deller at gmx.de> Am 13.02.24 um 09:42 schrieb Thomas Zimmermann:> Remove unnecessary dependencies in the include statements of the > header file <linux/fb.h>. Several files throughout the kernel include > the fbdev header, so reducing dependencies positively affects other > subsystems as well. Also fix up nouveau and fbtft, which need backlight.h > in some their source files. > > v2: > * include backlight.h in fbtft (kernel test robot) > > Thomas Zimmermann (8): > drm/nouveau: Include <linux/backlight.h> > staging/fbtft: Include <linux/backlight.h> > fbdev: Do not include <linux/backlight.h> in header > fbdev: Do not include <linux/fs.h> in header > fbdev: Do not include <linux/notifier.h> in header > fbdev: Do not include <linux/slab.h> in header > fbdev: Clean up forward declarations in header file > fbdev: Clean up include statements in header file > > drivers/gpu/drm/nouveau/dispnv50/disp.c | 1 + > drivers/staging/fbtft/fb_ssd1351.c | 2 ++ > include/linux/fb.h | 24 +++++++++++++----------- > 3 files changed, 16 insertions(+), 11 deletions(-) >-- -- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Frankenstrasse 146, 90461 Nuernberg, Germany GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman HRB 36809 (AG Nuernberg)
Maybe Matching Threads
- [PATCH] backlight: Avoid double fbcon backlight handling
- [Intel-gfx] [PATCH] backlight: Avoid double fbcon backlight handling
- [PATCH v3 0/9] fbdev: Clean up include dependencies in header
- [PATCH] virtio: pci: Use SIMPLE_DEV_PM_OPS macro
- [PATCH] virtio: pci: Use SIMPLE_DEV_PM_OPS macro