From: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
To: Sam Ravnborg <sam@ravnborg.org>
Cc: Joe Perches <joe@perches.com>,
Alexey Dobriyan <adobriyan@gmail.com>,
akpm@osdl.org, torvalds@osdl.org, viro@zeniv.linux.org.uk,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
linux-arch@vger.kernel.org
Subject: Re: [PATCH] proc_fs.h redux
Date: Mon, 29 Oct 2007 11:03:04 -0200 [thread overview]
Message-ID: <20071029130304.GA7810@ghostprotocols.net> (raw)
In-Reply-To: <20071028084441.GA24221@uranus.ravnborg.org>
Em Sun, Oct 28, 2007 at 09:44:41AM +0100, Sam Ravnborg escreveu:
> >
> > As a general rule, I think it better to use includes
> > than use naked forward declarations.
>
> Quite the opposite - at least in the kernel source.
> The general rule is that a .h file shall include the
> .h files which contain declarations used by said .h files.
> But naked declarations as above is preferred over including
> a full header file.
yup
> We see the full header dependency thing to blow off when
> inline function are used - which is more and more the case.
> In several cases we have converted inline functions to macros
> just to simplify the nightmare of header dependencies we have.
>
> Arnaldo have a nice script that generate a .ps file
> showing all the dependencies.
> He lately posted this URL: http://oops.ghostprotocols.net:81/acme/tcp.h.ps
Well, not "lately", it has been quite a while. But lets celebrate the
fact that there is somebody trying to fight this battle one more time
and update this tcp.h dependency tree... /me looks for hviz... and if
graphviz is installed, ok:
http://www.kernel.org/pub/linux/kernel/people/acme/hviz
hviz include/linux/tcp.h 10 | dot -Tpdf > /tmp/tcp.h.2007_11.pdf
http://oops.ghostprotocols.net:81/acme/tcp.h.2007_11.pdf
We still get to sched.h, but before it was:
linux/tcp.h -> linux/skbuff.h -> linux/mm.h -> linux/sched.h
Nowadays its:
linux/tcp.h -> linux/sock.h -> linux/netdevice.h -> linux/interrupt.h -> linux/sched.h
And I just removed "#include <linux/sched.h> from linux/interrupt.h,
because as far as I checked it is completely unnecessary, and the
kernel builds just fine :-)
- Arnaldo
next prev parent reply other threads:[~2007-10-29 13:03 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-27 19:47 [PATCH] proc_fs.h redux Alexey Dobriyan
2007-10-27 22:40 ` Joe Perches
2007-10-28 7:02 ` Alexey Dobriyan
2007-10-28 8:44 ` Sam Ravnborg
2007-10-29 13:03 ` Arnaldo Carvalho de Melo [this message]
2007-10-28 10:34 ` Russell King
2007-10-28 10:43 ` Jan Engelhardt
2007-10-28 11:59 ` Bernhard Walle
2007-10-28 13:04 ` Russell King
2007-10-28 13:25 ` Bernhard Walle
2007-10-28 17:58 ` Roman Zippel
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=20071029130304.GA7810@ghostprotocols.net \
--to=acme@ghostprotocols.net \
--cc=adobriyan@gmail.com \
--cc=akpm@osdl.org \
--cc=joe@perches.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=sam@ravnborg.org \
--cc=torvalds@osdl.org \
--cc=viro@zeniv.linux.org.uk \
/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;
as well as URLs for NNTP newsgroup(s).