From: Ingo Molnar <mingo@elte.hu>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: Jaswinder Singh Rajput <jaswinder@kernel.org>,
KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
Jaswinder Singh Rajput <jaswinderlinux@gmail.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
Sam Ravnborg <sam@ravnborg.org>,
Andrew Morton <akpm@linux-foundation.org>,
hskinnemoen@atmel.com, cooloney@kernel.org, tony.luck@intel.com,
ralf@linux-mips.org, dhowells@redhat.com, matthew@wil.cx,
chris@zankel.net, LKML <linux-kernel@vger.kernel.org>,
linux-next <linux-next@vger.kernel.org>,
linux-ia64 <linux-ia64@vger.kernel.org>
Subject: Re: [linux-next][PATCH] revert headers_check fix: ia64, fpu.h
Date: Fri, 6 Feb 2009 17:12:29 +0100 [thread overview]
Message-ID: <20090206161229.GA8256@elte.hu> (raw)
In-Reply-To: <20090206155512.GF13758@n2100.arm.linux.org.uk>
* Russell King - ARM Linux <linux@arm.linux.org.uk> wrote:
> > We cannot see any downside of this patch.
> >
> > But we can see upside of this patch is:
> > 1. No need to protect linux/types.h with #ifndef __ASSEMBLY__ in many
> > files
> > 2. So we trying to replace multiple #ifndef __ASSEMBLY__ with one.
>
> The point is:
>
> 1. If the parent include needs to include linux/types.h to get at C
> types _and_ the include file needs to also be included by assembly
> code, it itself needs to have #ifndef __ASSEMBLY__ to protect those
> uses from the assembly code.
>
> In that case, the linux/types.h include should be contained within
> the #ifndef __ASSEMBLY__ .. #endif block along with all C only
> parts of the header file.
That makes the code much less clean: putting #include's in the middle of a
header is poor style and leads to people failing to consider dependencies.
We generally put them to the header portion.
Putting an #include line in the middle of a header file is a receipe for a
dependency hell (it can easily fall inside #ifdefs, can be overlooked,
etc.), so it's _strongly_ discouraged (at least on arch/x86).
> 2. if it doesn't need C types from linux/types.h, then that header has
> no business including linux/types.h, and the include should be
> eliminated to save the already dirbolically slow compiler from
> having to read and parse that file, and more importantly allowing
> it to eliminate linux/types.h from the build dependencies.
>
> Yes, you can wrap linux/types.h with that ifndef, and yes it will fix any
> problems, but I view it as a hack rather than fixing the real problem
> which is lazyness by code writers to get their include dependencies right.
It is not about include dependencies at all - it is about the existing and
accepted practice which you did not consider in your argument: the use of
mixed-mode headers. A linux/types.h include there is perfectly clean and
should not break the build.
Again, i repeat: there is nothing wrong about making a small number of very
commonly used C header assembly-invariant. It results in better structured
header files and cleaner code.
The argument is as simple as that, and up until this email you wrote roughly
10 replies and it's not even that you disagreed with our point on some
honest basis that we could argue with - the ting is that you failed to even
_realize_ this argument of us and you tried to force your partial (and
trivially flawed) world view on us impatiently. In view of that you need to
be more careful before calling people 'stupidly obtuse' ;-)
Ingo
next prev parent reply other threads:[~2009-02-06 16:13 UTC|newest]
Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-31 7:10 [git pull -tip] headers_check fixes for other architectures Jaswinder Singh Rajput
2009-01-31 16:44 ` Ingo Molnar
2009-02-01 6:30 ` Jaswinder Singh Rajput
2009-02-01 10:39 ` Ingo Molnar
2009-02-01 16:49 ` Ingo Molnar
2009-02-01 17:06 ` Russell King - ARM Linux
2009-02-01 17:20 ` Russell King - ARM Linux
2009-02-01 17:31 ` Jaswinder Singh Rajput
2009-02-01 18:33 ` Jaswinder Singh Rajput
2009-02-02 17:11 ` Mike Frysinger
2009-02-02 18:08 ` Ingo Molnar
2009-02-02 18:29 ` Mike Frysinger
2009-02-02 18:48 ` Ingo Molnar
2009-02-05 17:55 ` Tony Luck
2009-02-05 19:06 ` Linus Torvalds
2009-02-05 19:19 ` Ingo Molnar
2009-02-06 2:06 ` Jaswinder Singh Rajput
2009-02-06 2:14 ` Mike Frysinger
2009-02-06 2:20 ` Ingo Molnar
2009-02-06 14:18 ` Jaswinder Singh Rajput
2009-02-06 14:21 ` Russell King - ARM Linux
2009-02-06 14:34 ` Jaswinder Singh Rajput
2009-02-06 14:51 ` Russell King - ARM Linux
2009-02-06 14:58 ` Ingo Molnar
2009-02-06 15:00 ` Jaswinder Singh Rajput
2009-02-06 15:10 ` Russell King - ARM Linux
2009-02-06 15:56 ` Ingo Molnar
2009-02-06 16:02 ` Russell King - ARM Linux
2009-02-06 17:24 ` Sam Ravnborg
2009-02-06 17:40 ` Ingo Molnar
2009-02-06 18:11 ` Jaswinder Singh Rajput
2009-02-06 18:42 ` Sam Ravnborg
2009-02-06 19:31 ` Jaswinder Singh Rajput
2009-02-08 5:50 ` Jaswinder Singh Rajput
2009-02-09 12:23 ` Ingo Molnar
2009-02-06 8:19 ` [linux-next][PATCH] revert headers_check fix: ia64, fpu.h KOSAKI Motohiro
2009-02-06 8:53 ` Jaswinder Singh Rajput
2009-02-06 9:11 ` KOSAKI Motohiro
2009-02-06 14:55 ` Ingo Molnar
2009-02-06 15:29 ` Jaswinder Singh Rajput
2009-02-06 15:33 ` Russell King - ARM Linux
2009-02-06 15:45 ` Ingo Molnar
2009-02-06 15:49 ` Russell King - ARM Linux
2009-02-06 16:01 ` Ingo Molnar
2009-02-06 15:48 ` Jaswinder Singh Rajput
2009-02-06 15:55 ` Russell King - ARM Linux
2009-02-06 16:12 ` Ingo Molnar [this message]
2009-02-06 16:23 ` Russell King - ARM Linux
2009-02-06 16:33 ` Ingo Molnar
2009-02-06 16:38 ` Russell King - ARM Linux
2009-02-06 17:14 ` Ingo Molnar
2009-02-06 17:22 ` Russell King - ARM Linux
2009-02-06 17:32 ` Sam Ravnborg
2009-02-06 17:41 ` Ingo Molnar
2009-02-06 18:53 ` Luck, Tony
2009-02-06 13:42 ` Sam Ravnborg
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=20090206161229.GA8256@elte.hu \
--to=mingo@elte.hu \
--cc=akpm@linux-foundation.org \
--cc=chris@zankel.net \
--cc=cooloney@kernel.org \
--cc=dhowells@redhat.com \
--cc=hskinnemoen@atmel.com \
--cc=jaswinder@kernel.org \
--cc=jaswinderlinux@gmail.com \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=linux-ia64@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=matthew@wil.cx \
--cc=ralf@linux-mips.org \
--cc=sam@ravnborg.org \
--cc=tony.luck@intel.com \
--cc=torvalds@linux-foundation.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