Re: [PATCH v2 01/11] thermal: core: Add and use thermal zone guard

Rafael J. Wysocki
2024-10-21T11:49:30Z

On Mon, Oct 21, 2024 at 1:41 PM Markus Elfring <Markus.Elfring@web.de> wrote:
>
> …
> > +++ linux-pm/drivers/thermal/thermal_helpers.c
> > @@ -60,13 +60,13 @@ bool thermal_trip_is_bound_to_cdev(struc
> > {
> > bool ret;
> >
> > - mutex_lock(&tz->lock);
> > + guard(thermal_zone)(tz);
> > +
> > mutex_lock(&cdev->lock);
> >
> > ret = thermal_instance_present(tz, cdev, trip);
> >
> > mutex_unlock(&cdev->lock);
> > - mutex_unlock(&tz->lock);
> >
> > return ret;
> > }
> …
>
> Would you become interested to apply a statement
> like “guard(mutex)(&cdev->lock);”?

Well, please see