Skip to content

Commit

Permalink
thermal: gov_step_wise: Simplify checks related to passive trips
Browse files Browse the repository at this point in the history
Make it more clear from the code flow that the passive polling status
updates only take place for passive trip points.

No intentional functional impact.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
  • Loading branch information
Rafael J. Wysocki committed Apr 8, 2024
1 parent f1164d3 commit 053b852
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions drivers/thermal/gov_step_wise.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,13 @@ static void thermal_zone_trip_update(struct thermal_zone_device *tz,
if (instance->initialized && old_target == instance->target)
continue;

if (old_target == THERMAL_NO_TARGET &&
instance->target != THERMAL_NO_TARGET) {
/* Activate a passive thermal instance */
if (trip->type == THERMAL_TRIP_PASSIVE)
if (trip->type == THERMAL_TRIP_PASSIVE) {
/* If needed, update the status of passive polling. */
if (old_target == THERMAL_NO_TARGET &&
instance->target != THERMAL_NO_TARGET)
tz->passive++;
} else if (old_target != THERMAL_NO_TARGET &&
instance->target == THERMAL_NO_TARGET) {
/* Deactivate a passive thermal instance */
if (trip->type == THERMAL_TRIP_PASSIVE)
else if (old_target != THERMAL_NO_TARGET &&
instance->target == THERMAL_NO_TARGET)
tz->passive--;
}

Expand Down

0 comments on commit 053b852

Please sign in to comment.