Re: [PATCH v3 1/2] thermal: sysfs: Rework the handling of trip point updates

From: Daniel Lezcano
Date: Mon Dec 04 2023 - 16:44:24 EST


On 04/12/2023 18:47, Rafael J. Wysocki wrote:

[ ... ]

+static int check_thermal_zone_and_trip_id(struct device *dev,
+ struct thermal_zone_device *tz,
+ int trip_id)
+{
+ if (!device_is_registered(dev))
+ return -ENODEV;
+
+ if (trip_id < 0 || trip_id >= tz->num_trips)
+ return -EINVAL;

I'm not sure if this check is useful. The function is called from
trip_point_*_store() which is providing the trip id from the file name
parsing which is in turn built from an existing trip id. There is no
reason the trip id is going to be wrong.

I can drop the check just fine.

Do you have any other comments on this patch?

No, the rest LGTM


--
<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