diff mbox

[GIT,PULL,-tip] fix 33 make headers_check warnings

Message ID 1232223441.3966.22.camel@localhost.localdomain (mailing list archive)
State Not Applicable
Headers show

Commit Message

Jaswinder Singh Rajput Jan. 17, 2009, 8:17 p.m. UTC
The following changes since commit 03b3e5ab1d1ac93bd45a6d3b38ab81785cda0d41:
  Ingo Molnar (1):
        Merge branch 'out-of-tree'

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/jaswinder/linux-2.6-tip.git master

Jaswinder Singh Rajput (26):
      can/bcm.h: fix make headers_check
      dvb/audio.h: fix make headers_check
      dvb/dmx.h: fix make headers_check
      dvb/frontend.h: fix make headers_check
      dvb/net.h: fix make headers_check
      dvb/video.h: fix make headers_check
      netfilter/xt_conntrack.h: fix make headers_check
      nfsd/export.h: fix make headers_check
      nfsd/nfsfh.h: fix make headers_check
      nfsd/stats.h: fix make headers_check
      nfsd/syscall.h: fix make headers_check
      raid/md_p.h: fix make headers_check
      spi/spidev.h: fix make headers_check
      tc_act/tc_gact.h: fix make headers_check
      tc_act/tc_mirred.h: fix make headers_check
      tc_act/tc_pedit.h: fix make headers_check
      tc_ematch/tc_em_cmp.h: fix make headers_check
      tc_ematch/tc_em_meta.h: fix make headers_check
      tc_ematch/tc_em_nbyte.h: fix make headers_check
      tc_ematch/tc_em_text.h: fix make headers_check
      usb/cdc.h: fix make headers_check
      usb/gadgetfs.h: fix make headers_check
      mtd/inftl-user.h: fix make headers_check
      sound/hdsp.h: fix make headers_check
      video/sisfb.h: fix make headers_check
      video/uvesafb.h: fix make headers_check

 include/linux/can/bcm.h                |    2 ++
 include/linux/dvb/audio.h              |    3 +--
 include/linux/dvb/dmx.h                |    2 +-
 include/linux/dvb/frontend.h           |    3 +--
 include/linux/dvb/net.h                |    3 +--
 include/linux/dvb/video.h              |    7 ++-----
 include/linux/netfilter/xt_conntrack.h |    1 +
 include/linux/nfsd/export.h            |    3 +--
 include/linux/nfsd/nfsfh.h             |    3 +--
 include/linux/nfsd/stats.h             |    2 ++
 include/linux/nfsd/syscall.h           |    3 +--
 include/linux/raid/md_p.h              |    2 ++
 include/linux/spi/spidev.h             |    1 +
 include/linux/tc_act/tc_gact.h         |    1 +
 include/linux/tc_act/tc_mirred.h       |    1 +
 include/linux/tc_act/tc_pedit.h        |    1 +
 include/linux/tc_ematch/tc_em_cmp.h    |    1 +
 include/linux/tc_ematch/tc_em_meta.h   |    1 +
 include/linux/tc_ematch/tc_em_nbyte.h  |    1 +
 include/linux/tc_ematch/tc_em_text.h   |    1 +
 include/linux/usb/cdc.h                |    2 ++
 include/linux/usb/gadgetfs.h           |    2 +-
 include/mtd/inftl-user.h               |    2 ++
 include/sound/hdsp.h                   |    2 ++
 include/video/sisfb.h                  |    2 +-
 include/video/uvesafb.h                |    2 ++
 26 files changed, 34 insertions(+), 20 deletions(-)



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

Comments

David Woodhouse Jan. 17, 2009, 9:37 p.m. UTC | #1
On Sun, 2009-01-18 at 01:47 +0530, Jaswinder Singh Rajput wrote:
> --- a/include/linux/dvb/audio.h
> +++ b/include/linux/dvb/audio.h
> @@ -24,9 +24,8 @@
>  #ifndef _DVBAUDIO_H_
>  #define _DVBAUDIO_H_
>  
> -#ifdef __KERNEL__
>  #include <linux/types.h>
> -#else
> +#ifndef __KERNEL__
>  #include <stdint.h>
>  #endif
>  

That patch looks wrong, and unnecessary. It was fine before.
Jan Engelhardt Jan. 17, 2009, 10:04 p.m. UTC | #2
On Saturday 2009-01-17 22:37, David Woodhouse wrote:
>On Sun, 2009-01-18 at 01:47 +0530, Jaswinder Singh Rajput wrote:
>> --- a/include/linux/dvb/audio.h
>> +++ b/include/linux/dvb/audio.h
>> @@ -24,9 +24,8 @@
>>  #ifndef _DVBAUDIO_H_
>>  #define _DVBAUDIO_H_
>>  
>> -#ifdef __KERNEL__
>>  #include <linux/types.h>
>> -#else
>> +#ifndef __KERNEL__
>>  #include <stdint.h>
>>  #endif
>
>That patch looks wrong, and unnecessary. It was fine before.

What itches my eye is

#ifndef __KERNEL__
#include <stdint.h>
#endif

I am not sure how much Linux header files are supposed to be usable
from C++, but in case someone does, <cstdint> should be used in C++0x
mode. Testing for C++0x with macros however looks even more out of
place in such header files.
Thoughts?
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Woodhouse Jan. 17, 2009, 10:23 p.m. UTC | #3
On Sat, 2009-01-17 at 23:19 +0100, Sam Ravnborg wrote:
> Nope - include/linux/dvb/audio.h failed to include linux/types.h
> despite the fact that is uses __u32 etc.

Er, good point. I saw the <stdint.h> and assumed it was using only
proper C types... but then it wouldn't have triggered the warning, would
it? Too much time in tin cans and not enough sleep...
H. Peter Anvin Jan. 17, 2009, 10:26 p.m. UTC | #4
Sam Ravnborg wrote:
>>>  
>> That patch looks wrong, and unnecessary. It was fine before.
> Nope - include/linux/dvb/audio.h failed to include linux/types.h
> despite the fact that is uses __u32 etc.
> 
> But why the _kernel_ should include a userspace header is
> much more questionable.
> 

<stdint.h> is one of a handful of headers provided by gcc itself.

	-hpa
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jaswinder Singh Rajput Jan. 18, 2009, 2:46 a.m. UTC | #5
Hello David,

On Sun, 2009-01-18 at 09:23 +1100, David Woodhouse wrote:
> On Sat, 2009-01-17 at 23:19 +0100, Sam Ravnborg wrote:
> > Nope - include/linux/dvb/audio.h failed to include linux/types.h
> > despite the fact that is uses __u32 etc.
> 
> Er, good point. I saw the <stdint.h> and assumed it was using only
> proper C types... but then it wouldn't have triggered the warning, would
> it? Too much time in tin cans and not enough sleep...
> 

Here is the list of 33  warnings this patchset solves:

  CHECK   include/linux/can (3 files)
/home/jaswinder/jaswinder-git/linux-2.6-tip/usr/include/linux/can/bcm.h:29: found __[us]{8,16,32,64} type without #include <linux/types.h>
  CHECK   include/linux/dvb (8 files)
/home/jaswinder/jaswinder-git/linux-2.6-tip/usr/include/linux/dvb/audio.h:133: found __[us]{8,16,32,64} type without #include <linux/types.h>
/home/jaswinder/jaswinder-git/linux-2.6-tip/usr/include/linux/dvb/dmx.h:27: include of <linux/types.h> is preferred over <asm/types.h>
/home/jaswinder/jaswinder-git/linux-2.6-tip/usr/include/linux/dvb/dmx.h:90: found __[us]{8,16,32,64} type without #include <linux/types.h>
/home/jaswinder/jaswinder-git/linux-2.6-tip/usr/include/linux/dvb/frontend.h:29: include of <linux/types.h> is preferred over <asm/types.h>
/home/jaswinder/jaswinder-git/linux-2.6-tip/usr/include/linux/dvb/frontend.h:76: found __[us]{8,16,32,64} type without #include <linux/types.h>
/home/jaswinder/jaswinder-git/linux-2.6-tip/usr/include/linux/dvb/net.h:27: include of <linux/types.h> is preferred over <asm/types.h>
/home/jaswinder/jaswinder-git/linux-2.6-tip/usr/include/linux/dvb/net.h:31: found __[us]{8,16,32,64} type without #include <linux/types.h>
/home/jaswinder/jaswinder-git/linux-2.6-tip/usr/include/linux/dvb/video.h:29: include of <linux/types.h> is preferred over <asm/types.h>
/home/jaswinder/jaswinder-git/linux-2.6-tip/usr/include/linux/dvb/video.h:102: found __[us]{8,16,32,64} type without #include <linux/types.h>
  CHECK   include/linux/hdlc (1 files)
  CHECK   include/linux/isdn (1 files)
  CHECK   include/linux/netfilter (49 files)
/home/jaswinder/jaswinder-git/linux-2.6-tip/usr/include/linux/netfilter/xt_conntrack.h:40: found __[us]{8,16,32,64} type without #include <linux/types.h>
  CHECK   include/linux/netfilter_arp (2 files)
  CHECK   include/linux/netfilter_bridge (16 files)
  CHECK   include/linux/netfilter_ipv4 (46 files)
  CHECK   include/linux/netfilter_ipv6 (20 files)
  CHECK   include/linux/nfsd (6 files)
/home/jaswinder/jaswinder-git/linux-2.6-tip/usr/include/linux/nfsd/export.h:13: include of <linux/types.h> is preferred over <asm/types.h>
/home/jaswinder/jaswinder-git/linux-2.6-tip/usr/include/linux/nfsd/nfsfh.h:17: include of <linux/types.h> is preferred over <asm/types.h>
/home/jaswinder/jaswinder-git/linux-2.6-tip/usr/include/linux/nfsd/nfsfh.h:28: found __[us]{8,16,32,64} type without #include <linux/types.h>
/home/jaswinder/jaswinder-git/linux-2.6-tip/usr/include/linux/nfsd/stats.h:32: leaks CONFIG_NFSD to userspace where it is not valid
/home/jaswinder/jaswinder-git/linux-2.6-tip/usr/include/linux/nfsd/syscall.h:12: include of <linux/types.h> is preferred over <asm/types.h>
/home/jaswinder/jaswinder-git/linux-2.6-tip/usr/include/linux/nfsd/syscall.h:104: found __[us]{8,16,32,64} type without #include <linux/types.h>
  CHECK   include/linux/raid (2 files)
/home/jaswinder/jaswinder-git/linux-2.6-tip/usr/include/linux/raid/md_p.h:85: found __[us]{8,16,32,64} type without #include <linux/types.h>
  CHECK   include/linux/spi (1 files)
/home/jaswinder/jaswinder-git/linux-2.6-tip/usr/include/linux/spi/spidev.h:83: found __[us]{8,16,32,64} type without #include <linux/types.h>
  CHECK   include/linux/sunrpc (1 files)
  CHECK   include/linux/tc_act (6 files)
/home/jaswinder/jaswinder-git/linux-2.6-tip/usr/include/linux/tc_act/tc_gact.h:19: found __[us]{8,16,32,64} type without #include <linux/types.h>
/home/jaswinder/jaswinder-git/linux-2.6-tip/usr/include/linux/tc_act/tc_mirred.h:16: found __[us]{8,16,32,64} type without #include <linux/types.h>
/home/jaswinder/jaswinder-git/linux-2.6-tip/usr/include/linux/tc_act/tc_pedit.h:19: found __[us]{8,16,32,64} type without #include <linux/types.h>
  CHECK   include/linux/tc_ematch (4 files)
/home/jaswinder/jaswinder-git/linux-2.6-tip/usr/include/linux/tc_ematch/tc_em_cmp.h:8: found __[us]{8,16,32,64} type without #include <linux/types.h>
/home/jaswinder/jaswinder-git/linux-2.6-tip/usr/include/linux/tc_ematch/tc_em_meta.h:18: found __[us]{8,16,32,64} type without #include <linux/types.h>
/home/jaswinder/jaswinder-git/linux-2.6-tip/usr/include/linux/tc_ematch/tc_em_nbyte.h:8: found __[us]{8,16,32,64} type without #include <linux/types.h>
/home/jaswinder/jaswinder-git/linux-2.6-tip/usr/include/linux/tc_ematch/tc_em_text.h:11: found __[us]{8,16,32,64} type without #include <linux/types.h>
  CHECK   include/linux/usb (8 files)
/home/jaswinder/jaswinder-git/linux-2.6-tip/usr/include/linux/usb/cdc.h:50: found __[us]{8,16,32,64} type without #include <linux/types.h>
/home/jaswinder/jaswinder-git/linux-2.6-tip/usr/include/linux/usb/gadgetfs.h:21: include of <linux/types.h> is preferred over <asm/types.h>
  CHECK   include/linux/wimax (1 files)
  CHECK   include/mtd (6 files)
/home/jaswinder/jaswinder-git/linux-2.6-tip/usr/include/mtd/inftl-user.h:61: found __[us]{8,16,32,64} type without #include <linux/types.h>
  CHECK   include/rdma (1 files)
  CHECK   include/sound (9 files)
/home/jaswinder/jaswinder-git/linux-2.6-tip/usr/include/sound/hdsp.h:33: found __[us]{8,16,32,64} type without #include <linux/types.h>
  CHECK   include/video (3 files)
/home/jaswinder/jaswinder-git/linux-2.6-tip/usr/include/video/sisfb.h:25: include of <linux/types.h> is preferred over <asm/types.h>
/home/jaswinder/jaswinder-git/linux-2.6-tip/usr/include/video/sisfb.h:78: found __[us]{8,16,32,64} type without #include <linux/types.h>
/home/jaswinder/jaswinder-git/linux-2.6-tip/usr/include/video/uvesafb.h:5: found __[us]{8,16,32,64} type without #include <linux/types.h>

--
JSR

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jaswinder Singh Rajput Jan. 18, 2009, 3:05 a.m. UTC | #6
Hello Sam, David,

On Sat, 2009-01-17 at 23:19 +0100, Sam Ravnborg wrote:
> On Sun, Jan 18, 2009 at 08:37:41AM +1100, David Woodhouse wrote:
> > On Sun, 2009-01-18 at 01:47 +0530, Jaswinder Singh Rajput wrote:
> > > --- a/include/linux/dvb/audio.h
> > > +++ b/include/linux/dvb/audio.h
> > > @@ -24,9 +24,8 @@
> > >  #ifndef _DVBAUDIO_H_
> > >  #define _DVBAUDIO_H_
> > >  
> > > -#ifdef __KERNEL__
> > >  #include <linux/types.h>
> > > -#else
> > > +#ifndef __KERNEL__
> > >  #include <stdint.h>
> > >  #endif
> > >  
> > 
> > That patch looks wrong, and unnecessary. It was fine before.
> Nope - include/linux/dvb/audio.h failed to include linux/types.h
> despite the fact that is uses __u32 etc.
> 

  CHECK   include/mtd (6 files)
/home/jaswinder/jaswinder-git/linux-2.6-tip/usr/include/mtd/jffs2-user.h:20: extern's make no sense in userspace

--
include/mtd/jffs2-user.h:

extern int target_endian;

#define t16(x) ({ uint16_t __b = (x); (target_endian==__BYTE_ORDER)?__b:bswap_16(__b); })
#define t32(x) ({ uint32_t __b = (x); (target_endian==__BYTE_ORDER)?__b:bswap_32(__b); })
--

In above case extern is OK or not ?

Do we have some better alternative.

Thanks
--
JSR

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Kyle McMartin Jan. 18, 2009, 3:33 a.m. UTC | #7
On Sun, Jan 18, 2009 at 08:35:01AM +0530, Jaswinder Singh Rajput wrote:
> Hello Sam, David,
> 
> /home/jaswinder/jaswinder-git/linux-2.6-tip/usr/include/mtd/jffs2-user.h:20: extern's make no sense in userspace
> 

This file is for userspace only, and it makes sense where it's used
(mtd-utils.)

In general though, this file doesn't actually depend on the kernel and
could be entirely provided from the userspace library.

http://lkml.org/lkml/2006/12/1/180

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jaswinder Singh Rajput Jan. 18, 2009, 3:38 a.m. UTC | #8
On Sat, 2009-01-17 at 22:33 -0500, Kyle McMartin wrote:
> On Sun, Jan 18, 2009 at 08:35:01AM +0530, Jaswinder Singh Rajput wrote:
> > Hello Sam, David,
> > 
> > /home/jaswinder/jaswinder-git/linux-2.6-tip/usr/include/mtd/jffs2-user.h:20: extern's make no sense in userspace
> > 
> 
> This file is for userspace only, and it makes sense where it's used
> (mtd-utils.)
> 
> In general though, this file doesn't actually depend on the kernel and
> could be entirely provided from the userspace library.
> 

If this file is _ONLY_ for userspace and kernel cannot use it then what
is the point of keeping this file in kernel headers.

--
JSR



--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Kyle McMartin Jan. 18, 2009, 4:18 a.m. UTC | #9
On Sun, Jan 18, 2009 at 09:08:24AM +0530, Jaswinder Singh Rajput wrote:
> If this file is _ONLY_ for userspace and kernel cannot use it then what
> is the point of keeping this file in kernel headers.
> 

There is effectively no point, especially when they reference a variable
that may or may not exist in the userspace code including it... It seems
entirely mtd-utils dependent.

Dave, will you queue Adrian's patch to nuke it?

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Stephen Rothwell Jan. 19, 2009, 12:24 a.m. UTC | #10
On Sun, 18 Jan 2009 01:47:21 +0530 Jaswinder Singh Rajput <jaswinder@kernel.org> wrote:
>
> diff --git a/include/linux/nfsd/stats.h b/include/linux/nfsd/stats.h
> index 7678cfb..0b53cfe 100644
> --- a/include/linux/nfsd/stats.h
> +++ b/include/linux/nfsd/stats.h
> @@ -29,9 +29,11 @@ struct nfsd_stats {
>  	unsigned int	ra_size;	/* size of ra cache */
>  	unsigned int	ra_depth[11];	/* number of times ra entry was found that deep
>  					 * in the cache (10percentiles). [10] = not found */
> +#ifdef __KERNEL__
>  #ifdef CONFIG_NFSD_V4
>  	unsigned int	nfs4_opcount[LAST_NFS4_OP + 1];	/* count of individual nfsv4 operations */
>  #endif
> +#endif /* __KERNEL__ */
>  
>  };

The only variable in the kernel of type "struct nfsd_stats" is only
exported to user mode via procfs, so this whole structure could probably
go inside __KERNEL__.  Then looking harder, I wonder if this header
should be exported to user mode at all.
Jaswinder Singh Rajput Jan. 19, 2009, 2:53 a.m. UTC | #11
On Mon, 2009-01-19 at 11:24 +1100, Stephen Rothwell wrote:
> On Sun, 18 Jan 2009 01:47:21 +0530 Jaswinder Singh Rajput <jaswinder@kernel.org> wrote:
> >
> > diff --git a/include/linux/nfsd/stats.h b/include/linux/nfsd/stats.h
> > index 7678cfb..0b53cfe 100644
> > --- a/include/linux/nfsd/stats.h
> > +++ b/include/linux/nfsd/stats.h
> > @@ -29,9 +29,11 @@ struct nfsd_stats {
> >  	unsigned int	ra_size;	/* size of ra cache */
> >  	unsigned int	ra_depth[11];	/* number of times ra entry was found that deep
> >  					 * in the cache (10percentiles). [10] = not found */
> > +#ifdef __KERNEL__
> >  #ifdef CONFIG_NFSD_V4
> >  	unsigned int	nfs4_opcount[LAST_NFS4_OP + 1];	/* count of individual nfsv4 operations */
> >  #endif
> > +#endif /* __KERNEL__ */
> >  
> >  };
> 
> The only variable in the kernel of type "struct nfsd_stats" is only
> exported to user mode via procfs, so this whole structure could probably
> go inside __KERNEL__.  Then looking harder, I wonder if this header
> should be exported to user mode at all.
> 

I was in doubt may be this will be used by some userspace utilities.

Once I got confirmation that it is not required in userspace, I will
remove it :-)

--
JSR

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jaswinder Singh Rajput Jan. 23, 2009, 3:56 p.m. UTC | #12
On Sat, 2009-01-17 at 23:18 -0500, Kyle McMartin wrote:
> On Sun, Jan 18, 2009 at 09:08:24AM +0530, Jaswinder Singh Rajput wrote:
> > If this file is _ONLY_ for userspace and kernel cannot use it then what
> > is the point of keeping this file in kernel headers.
> > 
> 
> There is effectively no point, especially when they reference a variable
> that may or may not exist in the userspace code including it... It seems
> entirely mtd-utils dependent.
> 
> Dave, will you queue Adrian's patch to nuke it?

What is the status of include/mtd/jffs2-user.h

--
JSR

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

Patch

diff --git a/include/linux/can/bcm.h b/include/linux/can/bcm.h
index 7f29327..1432b27 100644
--- a/include/linux/can/bcm.h
+++ b/include/linux/can/bcm.h
@@ -14,6 +14,8 @@ 
 #ifndef CAN_BCM_H
 #define CAN_BCM_H
 
+#include <linux/types.h>
+
 /**
  * struct bcm_msg_head - head of messages to/from the broadcast manager
  * @opcode:    opcode, see enum below.
diff --git a/include/linux/dvb/audio.h b/include/linux/dvb/audio.h
index 89412e1..758a48c 100644
--- a/include/linux/dvb/audio.h
+++ b/include/linux/dvb/audio.h
@@ -24,9 +24,8 @@ 
 #ifndef _DVBAUDIO_H_
 #define _DVBAUDIO_H_
 
-#ifdef __KERNEL__
 #include <linux/types.h>
-#else
+#ifndef __KERNEL__
 #include <stdint.h>
 #endif
 
diff --git a/include/linux/dvb/dmx.h b/include/linux/dvb/dmx.h
index 402fb7a..fef9437 100644
--- a/include/linux/dvb/dmx.h
+++ b/include/linux/dvb/dmx.h
@@ -24,7 +24,7 @@ 
 #ifndef _DVBDMX_H_
 #define _DVBDMX_H_
 
-#include <asm/types.h>
+#include <linux/types.h>
 #ifdef __KERNEL__
 #include <linux/time.h>
 #else
diff --git a/include/linux/dvb/frontend.h b/include/linux/dvb/frontend.h
index 55026b1..51c8d2d 100644
--- a/include/linux/dvb/frontend.h
+++ b/include/linux/dvb/frontend.h
@@ -26,8 +26,7 @@ 
 #ifndef _DVBFRONTEND_H_
 #define _DVBFRONTEND_H_
 
-#include <asm/types.h>
-
+#include <linux/types.h>
 
 typedef enum fe_type {
 	FE_QPSK,
diff --git a/include/linux/dvb/net.h b/include/linux/dvb/net.h
index 5be474b..f451e7e 100644
--- a/include/linux/dvb/net.h
+++ b/include/linux/dvb/net.h
@@ -24,8 +24,7 @@ 
 #ifndef _DVBNET_H_
 #define _DVBNET_H_
 
-#include <asm/types.h>
-
+#include <linux/types.h>
 
 struct dvb_net_if {
 	__u16 pid;
diff --git a/include/linux/dvb/video.h b/include/linux/dvb/video.h
index 50839fe..bd49c3e 100644
--- a/include/linux/dvb/video.h
+++ b/include/linux/dvb/video.h
@@ -24,17 +24,14 @@ 
 #ifndef _DVBVIDEO_H_
 #define _DVBVIDEO_H_
 
-#include <linux/compiler.h>
-
-#ifdef __KERNEL__
 #include <linux/types.h>
+#ifdef __KERNEL__
+#include <linux/compiler.h>
 #else
-#include <asm/types.h>
 #include <stdint.h>
 #include <time.h>
 #endif
 
-
 typedef enum {
 	VIDEO_FORMAT_4_3,     /* Select 4:3 format */
 	VIDEO_FORMAT_16_9,    /* Select 16:9 format. */
diff --git a/include/linux/netfilter/xt_conntrack.h b/include/linux/netfilter/xt_conntrack.h
index f3fd83e..8f53452 100644
--- a/include/linux/netfilter/xt_conntrack.h
+++ b/include/linux/netfilter/xt_conntrack.h
@@ -5,6 +5,7 @@ 
 #ifndef _XT_CONNTRACK_H
 #define _XT_CONNTRACK_H
 
+#include <linux/types.h>
 #include <linux/netfilter/nf_conntrack_tuple_common.h>
 
 #define XT_CONNTRACK_STATE_BIT(ctinfo) (1 << ((ctinfo)%IP_CT_IS_REPLY+1))
diff --git a/include/linux/nfsd/export.h b/include/linux/nfsd/export.h
index 5431512..bcd0201 100644
--- a/include/linux/nfsd/export.h
+++ b/include/linux/nfsd/export.h
@@ -10,9 +10,8 @@ 
 #ifndef NFSD_EXPORT_H
 #define NFSD_EXPORT_H
 
-#include <asm/types.h>
-#ifdef __KERNEL__
 # include <linux/types.h>
+#ifdef __KERNEL__
 # include <linux/in.h>
 #endif
 
diff --git a/include/linux/nfsd/nfsfh.h b/include/linux/nfsd/nfsfh.h
index b2e0938..fa317f6 100644
--- a/include/linux/nfsd/nfsfh.h
+++ b/include/linux/nfsd/nfsfh.h
@@ -14,9 +14,8 @@ 
 #ifndef _LINUX_NFSD_FH_H
 #define _LINUX_NFSD_FH_H
 
-#include <asm/types.h>
-#ifdef __KERNEL__
 # include <linux/types.h>
+#ifdef __KERNEL__
 # include <linux/string.h>
 # include <linux/fs.h>
 #endif
diff --git a/include/linux/nfsd/stats.h b/include/linux/nfsd/stats.h
index 7678cfb..0b53cfe 100644
--- a/include/linux/nfsd/stats.h
+++ b/include/linux/nfsd/stats.h
@@ -29,9 +29,11 @@  struct nfsd_stats {
 	unsigned int	ra_size;	/* size of ra cache */
 	unsigned int	ra_depth[11];	/* number of times ra entry was found that deep
 					 * in the cache (10percentiles). [10] = not found */
+#ifdef __KERNEL__
 #ifdef CONFIG_NFSD_V4
 	unsigned int	nfs4_opcount[LAST_NFS4_OP + 1];	/* count of individual nfsv4 operations */
 #endif
+#endif /* __KERNEL__ */
 
 };
 
diff --git a/include/linux/nfsd/syscall.h b/include/linux/nfsd/syscall.h
index 4e43976..7a3b565 100644
--- a/include/linux/nfsd/syscall.h
+++ b/include/linux/nfsd/syscall.h
@@ -9,9 +9,8 @@ 
 #ifndef NFSD_SYSCALL_H
 #define NFSD_SYSCALL_H
 
-#include <asm/types.h>
-#ifdef __KERNEL__
 # include <linux/types.h>
+#ifdef __KERNEL__
 # include <linux/in.h>
 #endif 
 #include <linux/posix_types.h>
diff --git a/include/linux/raid/md_p.h b/include/linux/raid/md_p.h
index 9491026..6ba830f 100644
--- a/include/linux/raid/md_p.h
+++ b/include/linux/raid/md_p.h
@@ -15,6 +15,8 @@ 
 #ifndef _MD_P_H
 #define _MD_P_H
 
+#include <linux/types.h>
+
 /*
  * RAID superblock.
  *
diff --git a/include/linux/spi/spidev.h b/include/linux/spi/spidev.h
index c93ef9d..95251cc 100644
--- a/include/linux/spi/spidev.h
+++ b/include/linux/spi/spidev.h
@@ -22,6 +22,7 @@ 
 #ifndef SPIDEV_H
 #define SPIDEV_H
 
+#include <linux/types.h>
 
 /* User space versions of kernel symbols for SPI clocking modes,
  * matching <linux/spi/spi.h>
diff --git a/include/linux/tc_act/tc_gact.h b/include/linux/tc_act/tc_gact.h
index 23a03eb..e895c0a 100644
--- a/include/linux/tc_act/tc_gact.h
+++ b/include/linux/tc_act/tc_gact.h
@@ -1,6 +1,7 @@ 
 #ifndef __LINUX_TC_GACT_H
 #define __LINUX_TC_GACT_H
 
+#include <linux/types.h>
 #include <linux/pkt_cls.h>
 
 #define TCA_ACT_GACT 5
diff --git a/include/linux/tc_act/tc_mirred.h b/include/linux/tc_act/tc_mirred.h
index 71d6340..0a99ab6 100644
--- a/include/linux/tc_act/tc_mirred.h
+++ b/include/linux/tc_act/tc_mirred.h
@@ -1,6 +1,7 @@ 
 #ifndef __LINUX_TC_MIR_H
 #define __LINUX_TC_MIR_H
 
+#include <linux/types.h>
 #include <linux/pkt_cls.h>
 
 #define TCA_ACT_MIRRED 8
diff --git a/include/linux/tc_act/tc_pedit.h b/include/linux/tc_act/tc_pedit.h
index 83e56e3..54ce906 100644
--- a/include/linux/tc_act/tc_pedit.h
+++ b/include/linux/tc_act/tc_pedit.h
@@ -1,6 +1,7 @@ 
 #ifndef __LINUX_TC_PED_H
 #define __LINUX_TC_PED_H
 
+#include <linux/types.h>
 #include <linux/pkt_cls.h>
 
 #define TCA_ACT_PEDIT 7
diff --git a/include/linux/tc_ematch/tc_em_cmp.h b/include/linux/tc_ematch/tc_em_cmp.h
index c7f4d43..38e7f7b 100644
--- a/include/linux/tc_ematch/tc_em_cmp.h
+++ b/include/linux/tc_ematch/tc_em_cmp.h
@@ -1,6 +1,7 @@ 
 #ifndef __LINUX_TC_EM_CMP_H
 #define __LINUX_TC_EM_CMP_H
 
+#include <linux/types.h>
 #include <linux/pkt_cls.h>
 
 struct tcf_em_cmp
diff --git a/include/linux/tc_ematch/tc_em_meta.h b/include/linux/tc_ematch/tc_em_meta.h
index c50d2ba..dcfb733 100644
--- a/include/linux/tc_ematch/tc_em_meta.h
+++ b/include/linux/tc_ematch/tc_em_meta.h
@@ -1,6 +1,7 @@ 
 #ifndef __LINUX_TC_EM_META_H
 #define __LINUX_TC_EM_META_H
 
+#include <linux/types.h>
 #include <linux/pkt_cls.h>
 
 enum
diff --git a/include/linux/tc_ematch/tc_em_nbyte.h b/include/linux/tc_ematch/tc_em_nbyte.h
index f19d1f5..9ed8c2e 100644
--- a/include/linux/tc_ematch/tc_em_nbyte.h
+++ b/include/linux/tc_ematch/tc_em_nbyte.h
@@ -1,6 +1,7 @@ 
 #ifndef __LINUX_TC_EM_NBYTE_H
 #define __LINUX_TC_EM_NBYTE_H
 
+#include <linux/types.h>
 #include <linux/pkt_cls.h>
 
 struct tcf_em_nbyte
diff --git a/include/linux/tc_ematch/tc_em_text.h b/include/linux/tc_ematch/tc_em_text.h
index 7cd43e9..d12a73a 100644
--- a/include/linux/tc_ematch/tc_em_text.h
+++ b/include/linux/tc_ematch/tc_em_text.h
@@ -1,6 +1,7 @@ 
 #ifndef __LINUX_TC_EM_TEXT_H
 #define __LINUX_TC_EM_TEXT_H
 
+#include <linux/types.h>
 #include <linux/pkt_cls.h>
 
 #define TC_EM_TEXT_ALGOSIZ	16
diff --git a/include/linux/usb/cdc.h b/include/linux/usb/cdc.h
index 18a7293..3c86ed2 100644
--- a/include/linux/usb/cdc.h
+++ b/include/linux/usb/cdc.h
@@ -9,6 +9,8 @@ 
 #ifndef __LINUX_USB_CDC_H
 #define __LINUX_USB_CDC_H
 
+#include <linux/types.h>
+
 #define USB_CDC_SUBCLASS_ACM			0x02
 #define USB_CDC_SUBCLASS_ETHERNET		0x06
 #define USB_CDC_SUBCLASS_WHCM			0x08
diff --git a/include/linux/usb/gadgetfs.h b/include/linux/usb/gadgetfs.h
index ea45f26..612102e 100644
--- a/include/linux/usb/gadgetfs.h
+++ b/include/linux/usb/gadgetfs.h
@@ -18,7 +18,7 @@ 
 #ifndef __LINUX_USB_GADGETFS_H
 #define __LINUX_USB_GADGETFS_H
 
-#include <asm/types.h>
+#include <linux/types.h>
 #include <asm/ioctl.h>
 
 #include <linux/usb/ch9.h>
diff --git a/include/mtd/inftl-user.h b/include/mtd/inftl-user.h
index e17eda3..d409d48 100644
--- a/include/mtd/inftl-user.h
+++ b/include/mtd/inftl-user.h
@@ -6,6 +6,8 @@ 
 #ifndef __MTD_INFTL_USER_H__
 #define __MTD_INFTL_USER_H__
 
+#include <linux/types.h>
+
 #define	OSAK_VERSION	0x5120
 #define	PERCENTUSED	98
 
diff --git a/include/sound/hdsp.h b/include/sound/hdsp.h
index dec6b1d..d98a78d 100644
--- a/include/sound/hdsp.h
+++ b/include/sound/hdsp.h
@@ -19,6 +19,8 @@ 
  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+#include <linux/types.h>
+
 #define HDSP_MATRIX_MIXER_SIZE 2048
 
 enum HDSP_IO_Type {
diff --git a/include/video/sisfb.h b/include/video/sisfb.h
index e402eb5..fdd74f1 100644
--- a/include/video/sisfb.h
+++ b/include/video/sisfb.h
@@ -21,8 +21,8 @@ 
 #ifndef _LINUX_SISFB_H_
 #define _LINUX_SISFB_H_
 
+#include <linux/types.h>
 #include <asm/ioctl.h>
-#include <asm/types.h>
 
 /**********************************************/
 /*                   PUBLIC                   */
diff --git a/include/video/uvesafb.h b/include/video/uvesafb.h
index 95bcef1..0993a22 100644
--- a/include/video/uvesafb.h
+++ b/include/video/uvesafb.h
@@ -1,6 +1,8 @@ 
 #ifndef _UVESAFB_H
 #define _UVESAFB_H
 
+#include <linux/types.h>
+
 struct v86_regs {
 	__u32 ebx;
 	__u32 ecx;