]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
thermal: core: Change passive_delay and polling_delay data type
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 5 Jul 2024 19:44:50 +0000 (21:44 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 9 Jul 2024 16:19:24 +0000 (18:19 +0200)
It is better to use unsigned int as the data type for the passive_delay
and polling_delay arguments of thermal_zone_device_register_with_trips()
because they are implicitly cast to unsigned int anyway in
thermal_set_delay_jiffies() and if they happen to be negative at that
point, the resulting behavior may not be as desired.

Update the thermal_zone_device_register_with_trips() definition
accordingly.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://patch.msgid.link/5803791.DvuYhMxLoT@rjwysocki.net
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/thermal/thermal_core.c
include/linux/thermal.h

index 3eb85301d32522b24a5f9f94244ae90729e99c0e..7139f729a83d4cf680cfba5e2f5ab661c0e9fcc1 100644 (file)
@@ -1356,7 +1356,8 @@ thermal_zone_device_register_with_trips(const char *type,
                                        int num_trips, void *devdata,
                                        const struct thermal_zone_device_ops *ops,
                                        const struct thermal_zone_params *tzp,
-                                       int passive_delay, int polling_delay)
+                                       unsigned int passive_delay,
+                                       unsigned int polling_delay)
 {
        const struct thermal_trip *trip = trips;
        struct thermal_zone_device *tz;
index f732dab203683702db82651cc8e0a4bd35b14672..cd0045915af50fd22f912754652454aba0e9fa11 100644 (file)
@@ -221,7 +221,8 @@ struct thermal_zone_device *thermal_zone_device_register_with_trips(
                                        int num_trips, void *devdata,
                                        const struct thermal_zone_device_ops *ops,
                                        const struct thermal_zone_params *tzp,
-                                       int passive_delay, int polling_delay);
+                                       unsigned int passive_delay,
+                                       unsigned int polling_delay);
 
 struct thermal_zone_device *thermal_tripless_zone_device_register(
                                        const char *type,