[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <6492701b-9723-56d0-a298-59e5cd896424@linaro.org>
Date: Mon, 26 Sep 2022 14:55:37 +0200
From: Daniel Lezcano <daniel.lezcano@...aro.org>
To: Zhang Rui <rui.zhang@...el.com>, rafael@...nel.org
Cc: linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org,
Amit Kucheria <amitk@...nel.org>
Subject: Re: [PATCH v4 02/30] thermal/sysfs: Do not make get_trip_hyst
optional
On 23/09/2022 16:19, Zhang Rui wrote:
> On Wed, 2022-09-21 at 11:42 +0200, Daniel Lezcano wrote:
>> The get_trip_hyst() ops is optional. It results all around the
>> thermal
>> framework code a check against the ops pointer and different action
>> adding more complexity and making the code less readable and
>> understandable.
>>
>> A zero hysteresis value is perfectly valid, so instead of adding more
>> circumvolutions in the code, create unconditionnaly the hysteresis
>> and
>> use the thermal_zone_get_trip() function which returns a zero
>> hysteresis if the get_trip_hyst() is not defined.
>
> I think an alternative way is to use the .is_visible() callback to make
> this cleanup transparent to userspace.
This would apply for the group not per trip point file, no?
> With this, we can remove the
> if (tz->ops->set_trip_hyst)check in create_trip_attrs() as well.
>
> But you make the cal. :)
>
> thanks,
> rui
>
>
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs
Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
Powered by blists - more mailing lists