[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <a810f45c-f538-43c3-8c43-f973f7758952@arm.com>
Date: Tue, 28 Nov 2023 13:15:21 +0000
From: Lukasz Luba <lukasz.luba@....com>
To: "Rafael J. Wysocki" <rafael@...nel.org>
Cc: "Rafael J. Wysocki" <rjw@...ysocki.net>,
LKML <linux-kernel@...r.kernel.org>,
Linux PM <linux-pm@...r.kernel.org>,
Daniel Lezcano <daniel.lezcano@...aro.org>,
Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>,
Zhang Rui <rui.zhang@...el.com>
Subject: Re: [PATCH v1] thermal: trip: Rework thermal_zone_set_trip() and its
callers
On 11/28/23 12:57, Rafael J. Wysocki wrote:
> On Tue, Nov 28, 2023 at 1:53 PM Rafael J. Wysocki <rafael@...nel.org> wrote:
>>
>> Hi Lukasz,
>>
>> On Tue, Nov 28, 2023 at 9:16 AM Lukasz Luba <lukasz.luba@....com> wrote:
>>>
>>> Hi Rafael,
>>>
>>> On 11/27/23 19:59, Rafael J. Wysocki wrote:
>>>> From: Rafael J. Wysocki <rafael.j.wysocki@...el.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.
Hmm, yes you're right. This is yet another sign to refactor the old
code.
For the rest of your comments in the earlier message - I agree.
When you post the v2 I can give it a try later today.
Regards,
Lukasz
Powered by blists - more mailing lists