Patchwork drm/tegra: Include header drm/drm.h

login
register
mail settings
Submitter Emil Goode
Date April 26, 2013, 5:49 p.m.
Message ID <1366998591-8508-1-git-send-email-emilgoode@gmail.com>
Download mbox | patch
Permalink /patch/239894/
State Not Applicable, archived
Headers show

Comments

Emil Goode - April 26, 2013, 5:49 p.m.
Include definitions of used types by including drm/drm.h

Sparse output:
/usr/include/drm/tegra_drm.h:21:
	found __[us]{8,16,32,64} type without
	#include <linux/types.h>

Signed-off-by: Emil Goode <emilgoode@gmail.com>
---
 include/uapi/drm/tegra_drm.h |    2 ++
 1 file changed, 2 insertions(+)
Thierry Reding - April 26, 2013, 7:22 p.m.
On Fri, Apr 26, 2013 at 07:49:51PM +0200, Emil Goode wrote:
> Include definitions of used types by including drm/drm.h
> 
> Sparse output:
> /usr/include/drm/tegra_drm.h:21:
> 	found __[us]{8,16,32,64} type without
> 	#include <linux/types.h>
> 
> Signed-off-by: Emil Goode <emilgoode@gmail.com>
> ---
>  include/uapi/drm/tegra_drm.h |    2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/include/uapi/drm/tegra_drm.h b/include/uapi/drm/tegra_drm.h
> index 6e132a2..73bde4e 100644
> --- a/include/uapi/drm/tegra_drm.h
> +++ b/include/uapi/drm/tegra_drm.h
> @@ -17,6 +17,8 @@
>  #ifndef _UAPI_TEGRA_DRM_H_
>  #define _UAPI_TEGRA_DRM_H_
>  
> +#include <drm/drm.h>
> +

sparse complains about linux/types.h not being included, so I wonder if
it makes more sense to include that instead of drm/drm.h. In fact I have
a fix that does exactly that in a local branch and was going to put that
into my fixes branch. It's a bit more lightweight.

On the other hand, some drivers already include drm/drm.h in the public
header so I don't really have any objections to this patch.

Thierry
Emil Goode - April 27, 2013, 9:49 a.m.
Hi Thierry,

I don't know this code well but the drm/drm.h has an #if def so that
either linux/types.h is included or the __[us]* types are defined in
a different way with the comment "One of the BSDs".
Also I sent a patch last year to include linux/types.h in exynos_drm.h
but it now includes drm/drm.h instead.

Best regards,

Emil Goode


On Fri, Apr 26, 2013 at 09:22:08PM +0200, Thierry Reding wrote:
> On Fri, Apr 26, 2013 at 07:49:51PM +0200, Emil Goode wrote:
> > Include definitions of used types by including drm/drm.h
> > 
> > Sparse output:
> > /usr/include/drm/tegra_drm.h:21:
> > 	found __[us]{8,16,32,64} type without
> > 	#include <linux/types.h>
> > 
> > Signed-off-by: Emil Goode <emilgoode@gmail.com>
> > ---
> >  include/uapi/drm/tegra_drm.h |    2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/include/uapi/drm/tegra_drm.h b/include/uapi/drm/tegra_drm.h
> > index 6e132a2..73bde4e 100644
> > --- a/include/uapi/drm/tegra_drm.h
> > +++ b/include/uapi/drm/tegra_drm.h
> > @@ -17,6 +17,8 @@
> >  #ifndef _UAPI_TEGRA_DRM_H_
> >  #define _UAPI_TEGRA_DRM_H_
> >  
> > +#include <drm/drm.h>
> > +
> 
> sparse complains about linux/types.h not being included, so I wonder if
> it makes more sense to include that instead of drm/drm.h. In fact I have
> a fix that does exactly that in a local branch and was going to put that
> into my fixes branch. It's a bit more lightweight.
> 
> On the other hand, some drivers already include drm/drm.h in the public
> header so I don't really have any objections to this patch.
> 
> Thierry


--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/include/uapi/drm/tegra_drm.h b/include/uapi/drm/tegra_drm.h
index 6e132a2..73bde4e 100644
--- a/include/uapi/drm/tegra_drm.h
+++ b/include/uapi/drm/tegra_drm.h
@@ -17,6 +17,8 @@ 
 #ifndef _UAPI_TEGRA_DRM_H_
 #define _UAPI_TEGRA_DRM_H_
 
+#include <drm/drm.h>
+
 struct drm_tegra_gem_create {
 	__u64 size;
 	__u32 flags;