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

H Hartley Sweeten hartleys at visionengravers.com
Mon Mar 29 13:23:17 EDT 2010


On Monday, March 29, 2010 10:20 AM, Russell King wrote:
> On Mon, Mar 29, 2010 at 12:16:32PM -0500, H Hartley Sweeten wrote:
>> On Saturday, March 27, 2010 1:57 PM, Linus Walleij wrote:
>>>> On Sat, Mar 27, 2010 at 2:43 PM, Linus Walleij
>>>>> 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.
>>>>
>>>>(...)
>>>> Again, according to above statement from submitchecklist:
>>>> shouldn't bus.h include device.h and resource.h, as it is using
>>>> these facilities.
>>>
>>> Yes I think you're right, looks like it should be applied then!
>>> Acked-by:
>> 
>> A cleaner solution would be to just add:
>> 
>> struct device;
>> struct resource;
>
> No - it needs the definitions themselves because it otherwise doesn't
> know how to lay out struct amba_device.
>
> What you suggest works fine for pointers, but not if the actual definition
> itself is required.

Oops my bad... I didn't notice that the variables were not pointers.

You are correct, the headers are needed to get the proper definitions.

Regards,
Hartley



More information about the linux-arm-kernel mailing list