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

From: Randy Dunlap
Date: Mon Jan 10 2011 - 10:50:39 EST


On Mon, 10 Jan 2011 12:44:24 +0100 Christoph Paasch wrote:

>
> On Monday, January 10, 2011 wrote Alexey Dobriyan:
> > >> linux/percpu_counter.h (needed for percpu_counter_sum_positive)
> > >
> > > Yes.
> >
> > Currently code compiles fine, so necessary headers are in place,
> > so simply adding new headers doesn't help anything.
>
> I totally agree with you.
> However we need a consistent coding style.
>
> Or we just include the minimum necessary headers (as originally proposed by
> me).
> Or we include every header whose structs/functions are referenced.
>
> In my opinion the current "mixed" state is not ok, because some includes are
> there because there *are* references (even if these includes could be omitted,
> e.g., linux/list.h).
> Other includes (like linux/percpu_counter.h) are not there, because they are
> indirectly included by another header and thus the code compiles. Even if
> there are references.
> And there are no rules/guidelines to identify the headers that should be
> included and those that should not.

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.


---
~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/