[PATCH] Consolidate clks_register() and similar

Russell King - ARM Linux linux at arm.linux.org.uk
Sun Jan 10 18:12:32 EST 2010


On Mon, Jan 11, 2010 at 09:23:31AM +1100, Jeremy Kerr wrote:
> Russell,
> 
> > --- a/arch/arm/mach-bcmring/core.c
> > +++ b/arch/arm/mach-bcmring/core.c
> > @@ -142,8 +142,7 @@ void __init bcmring_amba_init(void)
> > 
> >  	chipcHw_busInterfaceClockEnable(bus_clock);
> > 
> > -	for (i = 0; i < ARRAY_SIZE(lookups); i++)
> > -		clkdev_add(&lookups[i]);
> > +	clkdev_add_table(lookups, ARRAY_SIEZ(lookups));
> 
> SIEZ -> SIZE.

Fied.

> Also, perhaps a macro to simplify this common usage?
> 
> #define clkdev_add_table(clks) __clkdev_add_table(clks, ARRAY_SIZE(clks))

I'm not a fan of that kind of clean up - it leads people into
thinking that they can pass a normal pointer instead of an array to
clkdev_add_table() - and then they'll get a surprise.

PXA has ARRAY_AND_SIZE() which I think is rather nice for this kind of
thing, but other people had other thoughts on that...



More information about the linux-arm-kernel mailing list