From: ben-linux@fluff.org (Ben Dooks)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] Consolidate clks_register() and similar
Date: Mon, 11 Jan 2010 01:04:52 +0000 [thread overview]
Message-ID: <20100111010452.GF1224@trinity.fluff.org> (raw)
In-Reply-To: <20100110231232.GD15812@n2100.arm.linux.org.uk>
On Sun, Jan 10, 2010 at 11:12:32PM +0000, Russell King - ARM Linux wrote:
> 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...
I liked it, there are so many places in the kernel where this could
be used that I would love to se it added...
--
Ben
Q: What's a light-year?
A: One-third less calories than a regular year.
next prev parent reply other threads:[~2010-01-11 1:04 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-10 17:28 [PATCH] Consolidate clks_register() and similar Russell King - ARM Linux
2010-01-10 22:23 ` Jeremy Kerr
2010-01-10 23:12 ` Russell King - ARM Linux
2010-01-11 1:04 ` Ben Dooks [this message]
2010-01-11 17:26 ` H Hartley Sweeten
2010-01-11 17:28 ` Russell King - ARM Linux
2010-01-11 22:06 ` Kevin Hilman
2010-01-12 12:17 ` Russell King - ARM Linux
2010-01-12 17:29 ` H Hartley Sweeten
2010-01-12 17:35 ` Russell King - ARM Linux
2010-01-12 17:43 ` H Hartley Sweeten
2010-01-12 18:57 ` Russell King - ARM Linux
2010-01-12 19:16 ` Kevin Hilman
2010-01-12 0:11 ` Eric Miao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100111010452.GF1224@trinity.fluff.org \
--to=ben-linux@fluff.org \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).