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

Russell King - ARM Linux linux at arm.linux.org.uk
Mon Mar 29 13:19:47 EDT 2010


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.



More information about the linux-arm-kernel mailing list