drm: make drm_framebuffer.h self contained
Subsystems (2)
PATCH v2 4/14 drm: make drm_framebuffer.h self contained
Add forward declaration and pull in include
file to make drm_framebuffer.h self contained.
While add it order include files alphabetically.
The use of TASK_COMM_LEN is the reason for including sched.h. I could not see any good way to avoid this dependency, and users of drm_framebuffer.comm already use TASK_COMM_LEN to check for length etc.
--- include/drm/drm_framebuffer.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
include/drm/drm_framebuffer.h +4 -1
@@ -23,13 +23,16 @@#ifndef __DRM_FRAMEBUFFER_H__#define __DRM_FRAMEBUFFER_H__ -#include <linux/list.h> #include <linux/ctype.h> +#include <linux/list.h> +#include <linux/sched.h> +#include <drm/drm_mode_object.h> struct drm_framebuffer ;struct drm_file ;struct drm_device ; +struct drm_clip_rect ;/** * struct drm_framebuffer_funcs - framebuffer hooks
Signature · 1 line
2.12.0
Den 30.12.2018 18.48, skrev Sam Ravnborg:
Quoted 9 lines
Add forward declaration and pull in include
file to makedrm_framebuffer.hself contained.While add it order include files alphabetically.
The use of
TASK_COMM_LENis the reason for includingsched.h. I could not see any good way to avoid this dependency, and users of drm_framebuffer.comm already useTASK_COMM_LENto check for length etc.
We can't avoid including it, the macro is used here after all.
Quoted 20 lines
Signed-off-by Sam Ravnborg <[email protected]>Cc Maarten Lankhorst <[email protected]>Cc Maxime Ripard <[email protected]>Cc Sean Paul <[email protected]>Cc David Airlie <[email protected]>Cc Daniel Vetter <[email protected]>--- include/drm/drm_framebuffer.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)include/drm/drm_framebuffer.h +0
-1@@ -23,13 +23,16 @@#ifndef __DRM_FRAMEBUFFER_H__#define __DRM_FRAMEBUFFER_H__ -#include <linux/list.h>
include/drm/drm_framebuffer.h line 35
Quoted 10 lines
include/drm/drm_framebuffer.h +4
-0#include <linux/ctype.h> +#include <linux/list.h> +#include <linux/sched.h> +#include <drm/drm_mode_object.h> struct drm_framebuffer ;struct drm_file ;struct drm_device ; +struct drm_clip_rect ;
I think you can add drm_gem_object to this list.
include/drm/drm_framebuffer.h
Quoted 4 lines
include/drm/drm_framebuffer.h +0
-0/** * struct drm_framebuffer_funcs - framebuffer hooks