* Lee Jones <[email protected]> [140428 04:47]:
> > With the recommended twl4030 configuration added, we can now add
> > board specific changes as modifications to the recommended
> > configuration.
> > 
> > Cc: Peter De Schrijver <[email protected]>
> > Cc: Samuel Ortiz <[email protected]>
> > Cc: Lee Jones <[email protected]>
> > Signed-off-by: Tony Lindgren <[email protected]>
> > ---
> >  drivers/mfd/twl4030-power.c | 21 +++++++++++++++++++++
> >  include/linux/i2c/twl.h     |  1 +
> >  2 files changed, 22 insertions(+)
> > 
> > diff --git a/drivers/mfd/twl4030-power.c b/drivers/mfd/twl4030-power.c
> > index 89a8528..89c6b1a 100644
> > --- a/drivers/mfd/twl4030-power.c
> > +++ b/drivers/mfd/twl4030-power.c
> > @@ -511,13 +511,34 @@ twl4030_power_configure_scripts(const struct 
> > twl4030_power_data *pdata)
> >     return 0;
> >  }
> >  
> > +static void twl4030_patch_rconfig(struct twl4030_resconfig *common,
> > +                             struct twl4030_resconfig *board)
> > +{
> > +   while (common->resource) {
> > +           struct twl4030_resconfig *b = board;
> > +
> > +           while (b->resource) {
> > +                   if (b->resource == common->resource) {
> > +                           *common = *b;
> > +                           break;
> > +                   }
> > +                   b++;
> > +           }
> > +           common++;
> > +   }
> > +}
> 
> Forgive my ignorance, as I don't know how 'common' is setup, but we
> appear to move to the next 'common' reference them immediately
> dereference it without checking to see if it actually exists. Same
> with 'b'. What happens if we reach the end of the array? NULL
> dereference or does the final element always have a NULLed resource
> attribute?

Yes there's always a NULL entry at the end of the list always in
this case, and the configured lists are always static in the driver.

Regards,

Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to