[PATCH] Including device.h and resource.h header files in linux/amba/bus.h

viresh kumar viresh.linux at gmail.com
Sat Mar 27 07:55:49 EDT 2010


On Sat, Mar 27, 2010 at 2:43 PM, Linus Walleij
<linus.ml.walleij at gmail.com> wrote:
> 2010/3/27 viresh kumar <viresh.linux at gmail.com>:
>
>> Some time back i have initiated a thread regarding this type of issues. You can
>> find them here:
>>
>> http://lists.infradead.org/pipermail/linux-arm-kernel/2010-February/010258.html
>>
>> And my understanding after the discussion was:
>>
>> It is the responsibility of a header files, using types definitions
>> from outside world,
>> to include all header files required for proper compilation.
>> This is not the responsibility of the user using this file to add
>> dependency header in
>> his source files.
>
> On the other hand Documentation/SubmitChecklist contains this:
>
> 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.

I agree on the above statement.

But what if i don't want to use every type that is used in header file
i am including. For ex: I don't want to use resource
structure in my code and i need to include bus.h for some
other definition. Then why should i get a compilation warning.

Again, according to above statement from submitchecklist:
shouldn't bus.h include device.h and resource.h, as it is using
these facilities.

regards,
viresh kumar.



More information about the linux-arm-kernel mailing list