Skip to contentSkip to conversation

linux headers: include linux/types.h where appropriate

PATCH Superseded Bobby Powers 3 participants 5 messages Feb 23, 2012

Subsystems (5)
DRM drivers SCSI Sound DRM misc +1 more subsystems

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux headers: include linux/types.h where appropriate

This silences the related header check warnings.

---
 include/drm/drm_mode.h          |    2 ++
 include/drm/i915_drm.h          |    2 ++
 include/drm/mga_drm.h           |    2 ++
 include/drm/radeon_drm.h        |    2 ++
 include/drm/via_drm.h           |    2 ++
 include/linux/mmc/ioctl.h       |    3 +++
 include/scsi/scsi_netlink.h     |    2 +-
 include/sound/compress_params.h |    2 ++
 8 files changed, 16 insertions(+), 1 deletions(-)
include/drm/drm_mode.h +2 -0
index 2a2acda..4a0aae3 100644
@@ -27,6 +27,8 @@
 #ifndef _DRM_MODE_H
 #define _DRM_MODE_H
 
+#include <linux/types.h>
+
 #define DRM_DISPLAY_INFO_LEN	32
 #define DRM_CONNECTOR_NAME_LEN	32
 #define DRM_DISPLAY_MODE_LEN	32
include/drm/i915_drm.h +2 -0
index 924f6a4..74b0d6c 100644
@@ -29,6 +29,8 @@
 
 #include "drm.h"
 
+#include <linux/types.h>
+
 /* Please note that modifications to all structs defined here are
  * subject to backwards-compatibility constraints.
  */
include/drm/mga_drm.h +2 -0
index fca8170..6d4f427 100644
@@ -37,6 +37,8 @@
 
 #include "drm.h"
 
+#include <linux/types.h>
+
 /* WARNING: If you change any of these defines, make sure to change the
  * defines in the Xserver file (mga_sarea.h)
  */
include/drm/radeon_drm.h +2 -0
index b55da40..fdfedd2 100644
@@ -35,6 +35,8 @@
 
 #include "drm.h"
 
+#include <linux/types.h>
+
 /* WARNING: If you change any of these defines, make sure to change the
  * defines in the X server file (radeon_sarea.h)
  */
include/drm/via_drm.h +2 -0
index 79b3b6e..c6d0992 100644
@@ -26,6 +26,8 @@
 
 #include "drm.h"
 
+#include <linux/types.h>
+
 /* WARNING: These defines must be the same as what the Xserver uses.
  * if you change them, you must change the defines in the Xserver.
  */
include/linux/mmc/ioctl.h +3 -0
index 8fa5bc5..1f5e689 100644
@@ -1,5 +1,8 @@
 #ifndef LINUX_MMC_IOCTL_H
 #define LINUX_MMC_IOCTL_H
+
+#include <linux/types.h>
+
 struct mmc_ioc_cmd {
 	/* Implies direction of data.  true = write, false = read */
 	int write_flag;
include/scsi/scsi_netlink.h +1 -1
index 58ce8fe..5cb20cc 100644
@@ -23,7 +23,7 @@
 #define SCSI_NETLINK_H
 
 #include <linux/netlink.h>
-
+#include <linux/types.h>
 
 /*
  * This file intended to be included by both kernel and user space
include/sound/compress_params.h +2 -0
index d97d69f..da4a456 100644
@@ -51,6 +51,8 @@
 #ifndef __SND_COMPRESS_PARAMS_H
 #define __SND_COMPRESS_PARAMS_H
 
+#include <linux/types.h>
+
 /* AUDIO CODECS SUPPORTED */
 #define MAX_NUM_CODECS 32
 #define MAX_NUM_CODEC_DESCRIPTORS 32
Signature · 1 line
1.7.7.6
#1 lore raw
Quoted 2 lines

This silences the related header check warnings.

please fix the bug in the correct place, the drm.h header includes linux/types.h and this is one on purpose.

maybe expend some effort fixing the stupid tool to recurse like a normal preprocessor would.

Dave.

#2 lore raw
Quoted 8 lines · Dave Airlie
Quoted 2 lines

This silences the related header check warnings.

please fix the bug in the correct place, the drm.h header includes linux/types.h and this is one on purpose.

maybe expend some effort fixing the stupid tool to recurse like a normal preprocessor would.

Hah fair enough, I'll look into that later today then.

#3 lore raw
In reply to Dave Airlie
Quoted 8 lines · Dave Airlie
Quoted 2 lines

This silences the related header check warnings.

please fix the bug in the correct place, the drm.h header includes linux/types.h and this is one on purpose.

maybe expend some effort fixing the stupid tool to recurse like a normal preprocessor would.

Before we fix the tool maybe we should agree on what the tool should check for. One obvious thing to check is that we do not start to use user-land types in our exported headers like uint32_t etc.
Another could be that no header file should depend oon the user to include other header files.
Etc.

The checks we have implmented today are very conservative - but as you resist to add a few includes in the drm/drm*.h files prevents us from hitting zero warnings even with these conservative checks.

If we started to be more strict we would see much more warnings/errors. But all this fuzz about a handfull of includes in the drm header files sure scare me away from ever starting this.
I can only image the uproar some other changes may cause then.

Sam

#4 lore raw
Quoted 10 lines · Sam Ravnborg
Quoted 8 lines · Dave Airlie
Quoted 2 lines

This silences the related header check warnings.

please fix the bug in the correct place, the drm.h header includes linux/types.h and this is one on purpose.

maybe expend some effort fixing the stupid tool to recurse like a normal preprocessor would.

Quoted 6 lines

Before we fix the tool maybe we should agree on what the tool should check for. One obvious thing to check is that we do not start to use user-land types in our exported headers like uint32_t etc.
Another could be that no header file should depend oon the user to include other header files.
Etc.

I just sent out a patch that recursively checks for including types.h, as it was quite simple. Additional checks seem like they may be a good idea, but not something that has to be decided right here.

Quoted 8 lines

The checks we have implmented today are very conservative - but as you resist to add a few includes in the drm/drm*.h files prevents us from hitting zero warnings even with these conservative checks.

If we started to be more strict we would see much more warnings/errors. But all this fuzz about a handfull of includes in the drm header files sure scare me away from ever starting this.
I can only image the uproar some other changes may cause then.

Interestingly, with headers_check searching for types.h recursively (clearing up some noise), include/drm/drm_mode.h stands out as still needing to include <linux/types.h>, as it doesn't import drm.h.

Quoted 2 lines

       Sam