diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2024-04-03 21:12:02 +0300 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2024-04-08 16:57:50 +0300 |
commit | 053b852c46626250b5f7da43ba8574da756db022 (patch) | |
tree | a56820f69695bb11c70ef9cdc6d2c435498e5694 /drivers/thermal/gov_step_wise.c | |
parent | f1164d333cc3c063cfdf7d03ddbca4f93a5a5c41 (diff) | |
download | linux-053b852c46626250b5f7da43ba8574da756db022.tar.xz |
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 <rafael.j.wysocki@intel.com>
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Diffstat (limited to 'drivers/thermal/gov_step_wise.c')
-rw-r--r-- | drivers/thermal/gov_step_wise.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/thermal/gov_step_wise.c b/drivers/thermal/gov_step_wise.c index aad98e06d66b..ee2fb4e63d14 100644 --- a/drivers/thermal/gov_step_wise.c +++ b/drivers/thermal/gov_step_wise.c @@ -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--; } |