Re: [PATCH V2 3/5] PM / Domains: Save OPP table pointer in genpd

From: Viresh Kumar
Date: Fri Nov 30 2018 - 04:05:27 EST


On 30-11-18, 09:53, Ulf Hansson wrote:
> > diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
> > index 8e554e6a82a2..0d928359b880 100644
> > --- a/drivers/base/power/domain.c
> > +++ b/drivers/base/power/domain.c
> > @@ -1907,12 +1907,21 @@ int of_genpd_add_provider_simple(struct device_node *np,
> > ret);
> > goto unlock;
> > }
> > +
> > + /*
> > + * Save table for faster processing while setting performance
> > + * state.
> > + */
> > + genpd->opp_table = dev_pm_opp_get_opp_table(&genpd->dev);
> > + WARN_ON(!genpd->opp_table);
>
> The WARN_ON seems lazy. Why not implement a proper error path?

We just added the table before this call and so we should get the table no
matter what. Initially I wanted to add a BUG_ON() but then I relaxed it a bit :)

There is no point of error path here as that will never run.

--
viresh