public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [rfc] headers_check cleanups break the whole world
@ 2009-02-25  3:25 Kyle McMartin
  2009-02-25  6:24 ` H. Peter Anvin
  2009-02-25  6:56 ` Ingo Molnar
  0 siblings, 2 replies; 24+ messages in thread
From: Kyle McMartin @ 2009-02-25  3:25 UTC (permalink / raw)
  To: mingo; +Cc: dwmw2, linux-kernel, hpa

[names omitted to protect the innocent, hpa@ on the CC wrt klibc maybe
  using these? ]

Hi,

Commits like

    headers_check fix: foo.h
    
    fix the following 'make headers_check' warnings:
      usr/include/linux/foo.h:29: include of <linux/types.h> is preferred
      usr/include/linux/foo.h:102: found __[us]{8,16,32,64} type without

have proved problematic...

I've had to point out at least two userspace fixes[1] for a variety of
reasons that these patches exacerbated. Note however that I didn't say
they were wrong.

The reason for this is you cannot intermix glibc header <sys/*.h>
includes with <linux/*.h> includes for most things without defining the
__KERNEL_STRICT_NAMES guard. If you fail to define this, you end up
with multiple definitions of things like dev_t.

Software was able to get by, because things that used the headers, dvb for
example were not getting <linux/types.h> into the include chain, because
they were using <asm/types.h> directly.

I propose we invert that logic, so the presumable libc that makes use of
the <linux/types.h> header can just define that it wants these types.
(test __KERNEL__ as well so the kernel doesn't need a pointless
#define.)

If this isn't tenable, how about moving the {,__}[su]{8,16,32,64}
integer types into their own header, so we can avoid this mess ever
occuring in the future. I'm sure the janitors can have a field day with
that... :)

That said, who exactly is the userspace consumer for those
	typedef __kernel_dev_t	dev_t;
defines? Can we just include them all in #ifdef __KERNEL__?

Thoughts?

cheers, Kyle

1. Ok, one of them was libcap playing utterly stupid games with
<linux/capability.h> and header guards, but it was exacerbated by a
similar patch...


^ permalink raw reply	[flat|nested] 24+ messages in thread
* Re: [GIT PULL -tip] fix 22 make headers_check - 200901
@ 2009-02-04  6:43 Herbert Xu
  2009-02-05 14:30 ` Arnd Bergmann
  0 siblings, 1 reply; 24+ messages in thread
From: Herbert Xu @ 2009-02-04  6:43 UTC (permalink / raw)
  To: Jaswinder Singh Rajput
  Cc: mingo, x86, sam, hpa, jirislaby, gregkh, davem, xyzzy, arnd,
	mchehab, jens.axboe, linux-media, linux-kernel, Avi Kivity

Jaswinder Singh Rajput <jaswinder@kernel.org> wrote:
>
> diff --git a/arch/x86/include/asm/kvm.h b/arch/x86/include/asm/kvm.h
> index b95162a..d2e3bf3 100644
> --- a/arch/x86/include/asm/kvm.h
> +++ b/arch/x86/include/asm/kvm.h
> @@ -6,7 +6,7 @@
>  *
>  */
> 
> -#include <asm/types.h>
> +#include <linux/types.h>
> #include <linux/ioctl.h>

Awesome, you've just broken the userspace build of kvm as the
file linux/types.h conflicts with sys/types.h.

Thanks,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2009-02-26  0:07 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-25  3:25 [rfc] headers_check cleanups break the whole world Kyle McMartin
2009-02-25  6:24 ` H. Peter Anvin
2009-02-25  6:56 ` Ingo Molnar
2009-02-25  7:00   ` H. Peter Anvin
2009-02-25  7:05   ` Kyle McMartin
2009-02-25  7:08     ` H. Peter Anvin
2009-02-25  7:13       ` Kyle McMartin
2009-02-25  7:16         ` H. Peter Anvin
2009-02-25  7:22           ` Kyle McMartin
2009-02-25 18:17             ` [PATCH] Make exported headers use strict posix types Arnd Bergmann
2009-02-25 20:11               ` Sam Ravnborg
2009-02-25 21:42                 ` Arnd Bergmann
2009-02-25 21:58                 ` Arnd Bergmann
2009-02-25 22:07                   ` H. Peter Anvin
2009-02-25 22:39                     ` David Woodhouse
2009-02-25 23:58                       ` H. Peter Anvin
2009-02-25 23:07                 ` H. Peter Anvin
2009-02-26  0:01                   ` Arnd Bergmann
2009-02-26  0:04                     ` H. Peter Anvin
2009-02-25 11:34   ` [rfc] headers_check cleanups break the whole world Sam Ravnborg
  -- strict thread matches above, loose matches on Subject: below --
2009-02-04  6:43 [GIT PULL -tip] fix 22 make headers_check - 200901 Herbert Xu
2009-02-05 14:30 ` Arnd Bergmann
2009-02-05 15:17   ` H. Peter Anvin
2009-02-05 16:07     ` [PATCH] Make exported headers use strict posix types Arnd Bergmann
2009-02-05 17:54       ` H. Peter Anvin
2009-02-05 18:45       ` Arnd Bergmann
2009-02-17  9:38       ` Mauro Carvalho Chehab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox