All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Airlie <airlied@redhat.com>
To: Sam Ravnborg <sam@ravnborg.org>
Cc: lkml <linux-kernel@vger.kernel.org>,
	David Airlie <airlied@linux.ie>,
	dri-devel <dri-devel@lists.freedesktop.org>
Subject: Re: headers_check warnings in drm headers
Date: Tue, 17 Aug 2010 08:45:50 +1000	[thread overview]
Message-ID: <1281998750.3530.6.camel@clockmaker-el6> (raw)
In-Reply-To: <20100815192335.GA3438@merkur.ravnborg.org>

On Sun, 2010-08-15 at 21:23 +0200, Sam Ravnborg wrote:
> When I ran "make headers_check" on upstream I got following
> set of warnings for the drm headers:
> 
> usr/include/drm/drm_mode.h:85: found __[us]{8,16,32,64} type without #include <linux/types.h>
> usr/include/drm/i915_drm.h:120: found __[us]{8,16,32,64} type without #include <linux/types.h>
> usr/include/drm/mga_drm.h:260: found __[us]{8,16,32,64} type without #include <linux/types.h>
> usr/include/drm/radeon_drm.h:758: found __[us]{8,16,32,64} type without #include <linux/types.h>
> usr/include/drm/via_drm.h:117: found __[us]{8,16,32,64} type without #include <linux/types.h>
> 
> When I looked through the files I noticed a few things:
> 
> 1) Several files uses a mixture of native types and linux types.
>    For example "unsigned int" and "__u32" in the same file.
> 2) drm.h contains:
> #if defined(__linux__)
> 
> #include <linux/types.h>
> #include <asm/ioctl.h>
> typedef unsigned int drm_handle_t;
> 
> #else /* One of the BSDs */
> 
> #include <sys/ioccom.h>
> #include <sys/types.h>
> typedef int8_t   __s8;
> typedef uint8_t  __u8;
> typedef int16_t  __s16;
> typedef uint16_t __u16;
> typedef int32_t  __s32;
> typedef uint32_t __u32;
> typedef int64_t  __s64;
> typedef uint64_t __u64;
> typedef unsigned long drm_handle_t;
> 
> #endif
> 
> Why this when no-one else require this treatment?
> 
> 3) Lots of typedefs...
> 
> All in all - too much to dig into without knowing
> the background for the current state.
> 
> At a minimum please get the warnings fixed.

At a minimum please fix the checker to work.

It doesn't recurse, all of the .h files include drm.h, which includes
linux/types.h, this is how its meant to work. If the checker does
recurse then doesn't define __linux__ then fix that. This isn't a bug in
the drm header files.

We copy these files as is into a userspace that is shared with FreeBSD,
the ifdef is the minimum down from about 10 ifdefs 2-3 years ago
concession we've made.

Dave.


WARNING: multiple messages have this Message-ID (diff)
From: Dave Airlie <airlied@redhat.com>
To: Sam Ravnborg <sam@ravnborg.org>
Cc: lkml <linux-kernel@vger.kernel.org>,
	dri-devel <dri-devel@lists.freedesktop.org>
Subject: Re: headers_check warnings in drm headers
Date: Tue, 17 Aug 2010 08:45:50 +1000	[thread overview]
Message-ID: <1281998750.3530.6.camel@clockmaker-el6> (raw)
In-Reply-To: <20100815192335.GA3438@merkur.ravnborg.org>

On Sun, 2010-08-15 at 21:23 +0200, Sam Ravnborg wrote:
> When I ran "make headers_check" on upstream I got following
> set of warnings for the drm headers:
> 
> usr/include/drm/drm_mode.h:85: found __[us]{8,16,32,64} type without #include <linux/types.h>
> usr/include/drm/i915_drm.h:120: found __[us]{8,16,32,64} type without #include <linux/types.h>
> usr/include/drm/mga_drm.h:260: found __[us]{8,16,32,64} type without #include <linux/types.h>
> usr/include/drm/radeon_drm.h:758: found __[us]{8,16,32,64} type without #include <linux/types.h>
> usr/include/drm/via_drm.h:117: found __[us]{8,16,32,64} type without #include <linux/types.h>
> 
> When I looked through the files I noticed a few things:
> 
> 1) Several files uses a mixture of native types and linux types.
>    For example "unsigned int" and "__u32" in the same file.
> 2) drm.h contains:
> #if defined(__linux__)
> 
> #include <linux/types.h>
> #include <asm/ioctl.h>
> typedef unsigned int drm_handle_t;
> 
> #else /* One of the BSDs */
> 
> #include <sys/ioccom.h>
> #include <sys/types.h>
> typedef int8_t   __s8;
> typedef uint8_t  __u8;
> typedef int16_t  __s16;
> typedef uint16_t __u16;
> typedef int32_t  __s32;
> typedef uint32_t __u32;
> typedef int64_t  __s64;
> typedef uint64_t __u64;
> typedef unsigned long drm_handle_t;
> 
> #endif
> 
> Why this when no-one else require this treatment?
> 
> 3) Lots of typedefs...
> 
> All in all - too much to dig into without knowing
> the background for the current state.
> 
> At a minimum please get the warnings fixed.

At a minimum please fix the checker to work.

It doesn't recurse, all of the .h files include drm.h, which includes
linux/types.h, this is how its meant to work. If the checker does
recurse then doesn't define __linux__ then fix that. This isn't a bug in
the drm header files.

We copy these files as is into a userspace that is shared with FreeBSD,
the ifdef is the minimum down from about 10 ifdefs 2-3 years ago
concession we've made.

Dave.

  reply	other threads:[~2010-08-16 22:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-15 19:23 headers_check warnings in drm headers Sam Ravnborg
2010-08-16 22:45 ` Dave Airlie [this message]
2010-08-16 22:45   ` Dave Airlie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1281998750.3530.6.camel@clockmaker-el6 \
    --to=airlied@redhat.com \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sam@ravnborg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.