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

viresh kumar viresh.linux at gmail.com
Sat Mar 27 01:07:19 EDT 2010


On Fri, Mar 26, 2010 at 11:01 PM, Linus Walleij
<linus.ml.walleij at gmail.com> wrote:
> 2010/3/25 Viresh KUMAR <viresh.kumar at st.com>:
>
>> linux/amba/bus.h have dependencies on linux/device.h and linux/resource.h, but
>> it doesn't include them. We get compilation errors in our files which include
>> bus.h but doesn't include device.h and resource.h. This patch includes device.h
>> and resource.h in linux/amba/bus.h file.
>
> The customs of the kernel is to not #include .h files into each other so much,
> the reason being that this easily goes out of hand. Instead #include
> device.h and resource.h into your sourcefile above the amba/bus.h
> inclusion.
>

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.

Ex: As everybody who is going to use bus.h has to have device.h and
resource.h included.
So why not have all of them included once only. So that people don't
see compilation
warnings when they try to use these header files. And don't have to
add them in all source
files using them.

What do you say?

regards,
viresh kumar.



More information about the linux-arm-kernel mailing list