Re: [PATCH] Cleanup include/net/tcp.h include-files andcoding-style

From: Randy Dunlap
Date: Mon Jan 10 2011 - 11:30:36 EST


On Mon, 10 Jan 2011 17:24:45 +0100 Christoph Paasch wrote:

>
> On Monday, January 10, 2011 wrote Randy Dunlap:
> > Documentation/SubmitChecklist, #1:
> >
> > 1: If you use a facility then #include the file that defines/declares
> > that facility. Don't depend on other header files pulling in ones
> > that you use.
> Ok, great. That was the answer I was looking for.
>
> So, there is a clear rule that defines the #include-policy.
>
> Now, should the missing #include's be added, or not?
>
> Alexey Dobriyan is against it, as he says in one of his previous mails.
> And, I'm nearly sure that the rule is not respected in plenty of other files
> of the Linux Kernel.

If a build fails on any $architecture due to a missing header file, then
the header file should be added.

If you just want to fix source files that are missing header files, then
the patches should be accepted, even if they are not "needed" in some
strong sense of that word.

Adding the header files adds documentation that some interface from that
header file is being used and it prevents failures that would happen
if an indirect #include were removed, so it's a good practice, but sure,
there are plenty of places that miss this. It was added as Rule #1
(explicity as Rule __#1__) due to so many build errors due to this
that were occurring in linux-next trees.


---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/