Skip to content

Commit 053b852

Browse files
committed
thermal: gov_step_wise: Simplify checks related to passive trips
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 <[email protected]> Reviewed-by: Lukasz Luba <[email protected]>
1 parent f1164d3 commit 053b852

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

drivers/thermal/gov_step_wise.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,13 @@ static void thermal_zone_trip_update(struct thermal_zone_device *tz,
9292
if (instance->initialized && old_target == instance->target)
9393
continue;
9494

95-
if (old_target == THERMAL_NO_TARGET &&
96-
instance->target != THERMAL_NO_TARGET) {
97-
/* Activate a passive thermal instance */
98-
if (trip->type == THERMAL_TRIP_PASSIVE)
95+
if (trip->type == THERMAL_TRIP_PASSIVE) {
96+
/* If needed, update the status of passive polling. */
97+
if (old_target == THERMAL_NO_TARGET &&
98+
instance->target != THERMAL_NO_TARGET)
9999
tz->passive++;
100-
} else if (old_target != THERMAL_NO_TARGET &&
101-
instance->target == THERMAL_NO_TARGET) {
102-
/* Deactivate a passive thermal instance */
103-
if (trip->type == THERMAL_TRIP_PASSIVE)
100+
else if (old_target != THERMAL_NO_TARGET &&
101+
instance->target == THERMAL_NO_TARGET)
104102
tz->passive--;
105103
}
106104

0 commit comments

Comments
 (0)