RE: [PATCH] pinctrl: Store mapping table as a list of chunks

From: Stephen Warren
Date: Thu Feb 16 2012 - 18:41:32 EST


Linus Walleij wrote at Thursday, February 16, 2012 12:54 PM:
> On Wed, Feb 15, 2012 at 10:00 PM, Stephen Warren <swarren@xxxxxxxxxx> wrote:
> > arch/arm/mach-u300/core.c:
> > -static struct pinctrl_map __initdata u300_pinmux_map[] = {
> > +static struct pinctrl_map u300_pinmux_map[] = {
>
> This was actually not tagged __initdata until last merge window.
>
> The reason it was made discardable was for platform that needed
> to discard a large number of mappings after boot, since only a few
> of them got registered from the board files.

Ah right, yes I see that makes sense. I'll revert that and add back the
copy.

> (Yes, I know this will not be a problem in device tree configs...)

I'll create a helper function that doesn't do the copy for the DT case.

> Can we combine the best of two worlds by still making a
> shallow copy (like previously) and put that shallow copy into the
> list instead?
>
> > +#define for_each_maps(_maps_node_, _i_, _map_) \
> > +       list_for_each_entry(_maps_node_, &pinctrl_maps, node) \
> > +               for (_i_ = 0, _map_ = &_maps_node_->maps[_i_]; \
> > +                       _i_ < _maps_node_->num_maps; \
> > +                       i++, _map_ = &_maps_node_->maps[_i_])
>
> I really like this macro.

Checkpatch doesn't :-( but I think it's OK to ignore it in this case.

--
nvpublic

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/