Skip to content

Commit d05374d

Browse files
committed
thermal: core: Change passive_delay and polling_delay data type
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 <[email protected]> Acked-by: Daniel Lezcano <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 4acab50 commit d05374d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

drivers/thermal/thermal_core.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1356,7 +1356,8 @@ thermal_zone_device_register_with_trips(const char *type,
13561356
int num_trips, void *devdata,
13571357
const struct thermal_zone_device_ops *ops,
13581358
const struct thermal_zone_params *tzp,
1359-
int passive_delay, int polling_delay)
1359+
unsigned int passive_delay,
1360+
unsigned int polling_delay)
13601361
{
13611362
const struct thermal_trip *trip = trips;
13621363
struct thermal_zone_device *tz;

include/linux/thermal.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,8 @@ struct thermal_zone_device *thermal_zone_device_register_with_trips(
221221
int num_trips, void *devdata,
222222
const struct thermal_zone_device_ops *ops,
223223
const struct thermal_zone_params *tzp,
224-
int passive_delay, int polling_delay);
224+
unsigned int passive_delay,
225+
unsigned int polling_delay);
225226

226227
struct thermal_zone_device *thermal_tripless_zone_device_register(
227228
const char *type,

0 commit comments

Comments
 (0)