Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

thermal/core: Remove pointless thermal_zone_device_reset() function

The function thermal_zone_device_reset() is called in the
thermal_zone_device_register() which allocates and initialize the
structure. The passive field is already zero-ed by the allocation, the
function is useless.

Call directly thermal_zone_device_init() instead and
thermal_zone_device_reset().

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20201222181110.1231977-1-daniel.lezcano@linaro.org

+1 -7
+1 -7
drivers/thermal/thermal_core.c
··· 478 478 pos->initialized = false; 479 479 } 480 480 481 - static void thermal_zone_device_reset(struct thermal_zone_device *tz) 482 - { 483 - tz->passive = 0; 484 - thermal_zone_device_init(tz); 485 - } 486 - 487 481 static int thermal_zone_device_set_mode(struct thermal_zone_device *tz, 488 482 enum thermal_device_mode mode) 489 483 { ··· 1357 1363 1358 1364 INIT_DELAYED_WORK(&tz->poll_queue, thermal_zone_device_check); 1359 1365 1360 - thermal_zone_device_reset(tz); 1366 + thermal_zone_device_init(tz); 1361 1367 /* Update the new thermal zone and mark it as already updated. */ 1362 1368 if (atomic_cmpxchg(&tz->need_update, 1, 0)) 1363 1369 thermal_zone_device_update(tz, THERMAL_EVENT_UNSPECIFIED);