[PATCH v2 1/5] pmdomain: core: Rename genpd_status_on()
Ulf Hansson
ulf.hansson at oss.qualcomm.com
Thu Sep 3 05:10:38 PDT 2026
On Thu, Sep 3, 2026 at 2:00 PM Dhruva G <goledhruva at gmail.com> wrote:
>
> Hi Ulf,
>
> On 01-09-2026 16:44, Ulf Hansson wrote:
> > Let's rename the internal function genpd_status_on() to
> > genpd_status_on_unlocked() to clarify its use.
> >
> > Suggested-by: Abel Vesa <abel.vesa at oss.qualcomm.com>
> > Signed-off-by: Ulf Hansson <ulf.hansson at oss.qualcomm.com>
> > ---
>
> Optional:
> An additional line explaining why this otherwise unnecessary rename exists:
>
> Rename the accessor to leave genpd_status_on() available for a lock-taking wrapper
> introduced in a future commit.
Yeah, good point!
>
>
> >
> > Changes in v2:
> > - New patch.
> >
> > ---
> > drivers/pmdomain/core.c | 25 +++++++++++++------------
> > 1 file changed, 13 insertions(+), 12 deletions(-)
> >
> > diff --git a/drivers/pmdomain/core.c b/drivers/pmdomain/core.c
> > index 842c4169e290..6ac1ce18fda3 100644
> > --- a/drivers/pmdomain/core.c
> > +++ b/drivers/pmdomain/core.c
> > @@ -173,7 +173,7 @@ static const struct genpd_lock_ops genpd_raw_spin_ops = {
> > #define genpd_lock_interruptible(p) p->lock_ops->lock_interruptible(p)
> > #define genpd_unlock(p) p->lock_ops->unlock(p)
> >
> > -#define genpd_status_on(genpd) (genpd->status == GENPD_STATE_ON)
> > +#define genpd_status_on_unlocked(genpd) (genpd->status == GENPD_STATE_ON)
> > #define genpd_is_irq_safe(genpd) (genpd->flags & GENPD_FLAG_IRQ_SAFE)
> > #define genpd_is_always_on(genpd) (genpd->flags & GENPD_FLAG_ALWAYS_ON)
> > #define genpd_is_active_wakeup(genpd) (genpd->flags & GENPD_FLAG_ACTIVE_WAKEUP)
> > @@ -771,7 +771,7 @@ EXPORT_SYMBOL_GPL(dev_pm_genpd_rpm_always_on);
> > * @dev: Device to get the current power status
> > *
> > * This function checks whether the generic power domain associated with the
> > - * given device is on or not by verifying if genpd_status_on equals
> > + * given device is on or not by verifying if genpd_status_on_unlocked equals
> > * GENPD_STATE_ON.
>
> Since we're fixing this anyway, It should describe comparing genpd->status with GENPD_STATE_ON, not the macro
> which expands to that logic ;)
Of course, my search/replace logic was too lazy.
>
> Anyway, nits only, LGTM otherwise.
>
> Reviewed-by: Dhruva Gole <goledhruva at gmail.com>
>
>
Thanks, I will send a new version to address your comments!
Kind regards
Uffe
More information about the linux-arm-kernel
mailing list