Messages in this thread | | | From | "Rafael J. Wysocki" <> | Date | Tue, 28 Nov 2023 13:57:50 +0100 | Subject | Re: [PATCH v1] thermal: trip: Rework thermal_zone_set_trip() and its callers |
| |
On Tue, Nov 28, 2023 at 1:53 PM Rafael J. Wysocki <rafael@kernel.org> wrote: > > Hi Lukasz, > > On Tue, Nov 28, 2023 at 9:16 AM Lukasz Luba <lukasz.luba@arm.com> wrote: > > > > Hi Rafael, > > > > On 11/27/23 19:59, Rafael J. Wysocki wrote: > > > From: Rafael J. Wysocki <rafael.j.wysocki@intel.com> > > >
[cut]
> > > Index: linux-pm/drivers/thermal/thermal_trip.c > > > =================================================================== > > > --- linux-pm.orig/drivers/thermal/thermal_trip.c > > > +++ linux-pm/drivers/thermal/thermal_trip.c > > > @@ -148,42 +148,61 @@ int thermal_zone_get_trip(struct thermal > > > EXPORT_SYMBOL_GPL(thermal_zone_get_trip); > > > > > > int thermal_zone_set_trip(struct thermal_zone_device *tz, int trip_id, > > > - const struct thermal_trip *trip) > > > + enum thermal_set_trip_target what, const char *buf) > > > { > > > - struct thermal_trip t; > > > - int ret; > > > + struct thermal_trip *trip; > > > + int val, ret = 0; > > > > > > - if (!tz->ops->set_trip_temp && !tz->ops->set_trip_hyst && !tz->trips) > > > - return -EINVAL; > > > > Here we could bail out when there are no callbacks. > > Not really, because the trip is updated regardless.
Actually, the condition above is always false after recent changes, because tz->trips[] is always present, so the if () statement is redundant.
| |