[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c1d4ec94cc666897d8e493364352bd1442bdb819.camel@intel.com>
Date: Fri, 23 Sep 2022 22:19:05 +0800
From: Zhang Rui <rui.zhang@...el.com>
To: Daniel Lezcano <daniel.lezcano@...aro.org>, 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 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.
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
Powered by blists - more mailing lists