From: "Robert P. J. Day" <rpjday@crashcourse.ca>
To: David Woodhouse <dwmw2@infradead.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: why so many unexported headers checking __KERNEL__?
Date: Wed, 26 Mar 2008 09:16:32 -0400 (EDT) [thread overview]
Message-ID: <alpine.LFD.1.00.0803260913350.6316@localhost.localdomain> (raw)
In-Reply-To: <1206537022.9540.274.camel@pmac.infradead.org>
On Wed, 26 Mar 2008, David Woodhouse wrote:
> On Wed, 2008-03-26 at 08:53 -0400, Robert P. J. Day wrote:
> > not surprisingly, the only reason i noticed the above was because
> > i hacked together a short script that went looking for all of the
> > above and i was surprised at the number of files it identified.
>
> It's not _that_ surprising. Remember, before headers_install people
> just used to copy _all_ the headers across, and so the only way to
> hide stuff was to wrap entire files in #ifdef __KERNEL__.
ah, i had no idea. that explains it.
> > p.s. the other case that could be identified is when a header file
> > has its *entire* contents encased in a __KERNEL__ test, (either
> > ifdef or ifndef). AFAICT, unless that kind of test is
> > partitioning *some* of a header file content from the remainder,
> > there's little value in a __KERNEL__test if the end result is to
> > either:
> >
> > a) leave the file exactly as is, or
> > b) reduce it to empty
>
> Right.
>
> If it's entirely #ifndef __KERNEL__ then it's a userspace header. It
> probably doesn't live in the kernel source tree at all.
>
> If it's entirely #ifdef __KERNEL__ then it shouldn't be exported at
> all (although when we do that we sometimes have to deal with
> userspace programs which include it even though it's empty).
well, since i already have the output from my script, i might toss
together some per-directory patches to start removing some of that.
this sounds more like a one-shot thing than adding permanent checking
to the build process.
rday
--
========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry:
Have classroom, will lecture.
http://crashcourse.ca Waterloo, Ontario, CANADA
========================================================================
next prev parent reply other threads:[~2008-03-26 13:16 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-23 6:31 Robert P. J. Day
2008-03-26 12:08 ` David Woodhouse
2008-03-26 12:53 ` Robert P. J. Day
2008-03-26 13:10 ` David Woodhouse
2008-03-26 13:16 ` Robert P. J. Day [this message]
2008-03-26 13:19 ` David Woodhouse
2008-03-26 13:23 ` Robert P. J. Day
2008-03-26 13:37 ` Robert P. J. Day
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=alpine.LFD.1.00.0803260913350.6316@localhost.localdomain \
--to=rpjday@crashcourse.ca \
--cc=dwmw2@infradead.org \
--cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®