[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20071029130304.GA7810@ghostprotocols.net>
Date: Mon, 29 Oct 2007 11:03:04 -0200
From: Arnaldo Carvalho de Melo <acme@...stprotocols.net>
To: Sam Ravnborg <sam@...nborg.org>
Cc: Joe Perches <joe@...ches.com>,
Alexey Dobriyan <adobriyan@...il.com>, akpm@...l.org,
torvalds@...l.org, viro@...iv.linux.org.uk,
linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
linux-arch@...r.kernel.org
Subject: Re: [PATCH] proc_fs.h redux
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
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists