Skip to content

Commit

Permalink
thermal: core: Drop dead code from monitor_thermal_zone()
Browse files Browse the repository at this point in the history
Since monitor_thermal_zone() is only called when the given thermal zone
has been enabled, as per the thermal_zone_device_is_enabled() check in
__thermal_zone_device_update(), the tz->mode check in it always
evaluates to "false" and the thermal_zone_device_set_polling()
invocation depending on it is dead code, so drop it.

No functional impact.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://patch.msgid.link/10547425.nUPlyArG6x@rjwysocki.net
  • Loading branch information
Rafael J. Wysocki committed Sep 5, 2024
1 parent 49029b5 commit fcfacd5
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/thermal/thermal_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -364,9 +364,7 @@ static void thermal_zone_recheck(struct thermal_zone_device *tz, int error)

static void monitor_thermal_zone(struct thermal_zone_device *tz)
{
if (tz->mode != THERMAL_DEVICE_ENABLED)
thermal_zone_device_set_polling(tz, 0);
else if (tz->passive > 0)
if (tz->passive > 0)
thermal_zone_device_set_polling(tz, tz->passive_delay_jiffies);
else if (tz->polling_delay_jiffies)
thermal_zone_device_set_polling(tz, tz->polling_delay_jiffies);
Expand Down

0 comments on commit fcfacd5

Please sign in to comment.