Skip to contentSkip to conversation

drm: shmobile: Reduce include dependencies

PATCH Superseded Andy Shevchenko 3 participants 4 messages Feb 5, 2020 – Feb 6, 2020 DRM drivers for Renesas shmobile

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 drm: shmobile: Reduce include dependencies

This file doesn't need everything provided by <linux/kernel.h>. All it needs are some types, which are provided by <linux/types.h>.

Note, <drm/drm_mode.h> already includes <linux/types.h>, but not relying on implicit includes is indeed a good thing.

---
v2: Update commit message (Geert, Laurent)

 include/linux/platform_data/shmob_drm.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/platform_data/shmob_drm.h +1 -1
index fe815d7d9f58..08605fdb2226 100644
@@ -10,7 +10,7 @@
 #ifndef __SHMOB_DRM_H__
 #define __SHMOB_DRM_H__
 
-#include <linux/kernel.h>
+#include <linux/types.h>
 
 #include <drm/drm_mode.h>
 
Signature · 1 line
2.24.1
Reviewed-by on v2 1/1
#1 lore raw

Hi Andy,

Quoted 5 lines · Andy Shevchenko

This file doesn't need everything provided by <linux/kernel.h>. All it needs are some types, which are provided by <linux/types.h>.

Note, <drm/drm_mode.h> already includes <linux/types.h>, but not relying on implicit includes is indeed a good thing.

This explains things a bit better :-)

I'm sure the others will follow too, but here's my:

Quoted 20 lines

---
v2: Update commit message (Geert, Laurent)

 include/linux/platform_data/shmob_drm.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/platform_data/shmob_drm.h +1 -1
index fe815d7d9f58..08605fdb2226 100644
@@ -10,7 +10,7 @@
 #ifndef __SHMOB_DRM_H__
 #define __SHMOB_DRM_H__
 
-#include <linux/kernel.h>
+#include <linux/types.h>
 
 #include <drm/drm_mode.h>
 
maintainer
#2 lore raw
In reply to Andy Shevchenko

Hi Andy,

Thank you for the patch.

Quoted 5 lines · Andy Shevchenko

This file doesn't need everything provided by <linux/kernel.h>. All it needs are some types, which are provided by <linux/types.h>.

Note, <drm/drm_mode.h> already includes <linux/types.h>, but not relying on implicit includes is indeed a good thing.

Do we even need linux/types.h ? Apart from struct drm_mode_modeinfo, shmob_drm.h seems to only contain plain C without using any externally defined types.

Quoted 19 lines

---
v2: Update commit message (Geert, Laurent)

 include/linux/platform_data/shmob_drm.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/platform_data/shmob_drm.h +1 -1
index fe815d7d9f58..08605fdb2226 100644
@@ -10,7 +10,7 @@
 #ifndef __SHMOB_DRM_H__
 #define __SHMOB_DRM_H__
 
-#include <linux/kernel.h>
+#include <linux/types.h>
 
 #include <drm/drm_mode.h>
 
Signature · 3 lines
Regards,

Laurent Pinchart
#3 lore raw
Quoted 8 lines · Laurent Pinchart

Hi Andy,

Thank you for the patch.

Quoted 3 lines · Andy Shevchenko

This file doesn't need everything provided by <linux/kernel.h>. All it needs are some types, which are provided by <linux/types.h>.

Quoted 6 lines
Quoted 2 lines

Note, <drm/drm_mode.h> already includes <linux/types.h>, but not relying on implicit includes is indeed a good thing.

Do we even need linux/types.h ? Apart from struct drm_mode_modeinfo, shmob_drm.h seems to only contain plain C without using any externally defined types.

Good point. It doesn't contain neither bool nor uXX or alike types. Probably we may simple drop the inclusion. I'll send v3.

Signature · 2 lines
With Best Regards,
Andy Shevchenko