From 17d399cd9c8936909bc8936a5837b6da9af9c29e Mon Sep 17 00:00:00 2001 From: Daniel Lezcano Date: Wed, 16 Dec 2020 23:03:35 +0100 Subject: thermal/core: Precompute the delays from msecs to jiffies The delays are stored in ms units and when the polling function is called this delay is converted into jiffies at each call. Instead of doing the conversion again and again, compute the jiffies at init time and use the value directly when setting the polling. Cc: Thara Gopinath Signed-off-by: Daniel Lezcano Reviewed-by: Lukasz Luba Reviewed-by: Thara Gopinath Link: https://lore.kernel.org/r/20201216220337.839878-1-daniel.lezcano@linaro.org --- drivers/thermal/thermal_core.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/thermal/thermal_core.c') diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index bcc2ea4f5482..2c41d4a0923f 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -1315,6 +1315,9 @@ thermal_zone_device_register(const char *type, int trips, int mask, tz->passive_delay = passive_delay; tz->polling_delay = polling_delay; + thermal_set_delay_jiffies(&tz->passive_delay_jiffies, passive_delay); + thermal_set_delay_jiffies(&tz->polling_delay_jiffies, polling_delay); + /* sys I/F */ /* Add nodes that are always present via .groups */ result = thermal_zone_create_device_groups(tz, mask); -- cgit 1.4.1