diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2024-04-10 19:12:45 +0300 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2024-04-23 21:39:50 +0300 |
commit | ca0e9728d37215afe943d508a1935d13a96ea88e (patch) | |
tree | 980c02a7ea0420b42295222e75264d35966bcfcb /drivers/thermal | |
parent | 41ddbcc6fd2cd8ec3100fdea9044f3f377b6ec11 (diff) | |
download | linux-ca0e9728d37215afe943d508a1935d13a96ea88e.tar.xz |
thermal: gov_power_allocator: Eliminate a redundant variable
Notice that the passive field in struct thermal_zone_device is not
used by the Power Allocator governor itself and so the ordering of
its updates with respect to allow_maximum_power() or allocate_power()
does not matter.
Accordingly, make power_allocator_manage() update that field right
before returning, which allows the current value of it to be passed
directly to allow_maximum_power() without using the additional update
variable that can be dropped.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Diffstat (limited to 'drivers/thermal')
-rw-r--r-- | drivers/thermal/gov_power_allocator.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/thermal/gov_power_allocator.c b/drivers/thermal/gov_power_allocator.c index 008b3ed60a91..7450ab77d5f0 100644 --- a/drivers/thermal/gov_power_allocator.c +++ b/drivers/thermal/gov_power_allocator.c @@ -747,21 +747,18 @@ static void power_allocator_manage(struct thermal_zone_device *tz) { struct power_allocator_params *params = tz->governor_data; const struct thermal_trip *trip = params->trip_switch_on; - bool update; lockdep_assert_held(&tz->lock); if (trip && tz->temperature < trip->temperature) { - update = tz->passive; - tz->passive = 0; reset_pid_controller(params); - allow_maximum_power(tz, update); + allow_maximum_power(tz, tz->passive); + tz->passive = 0; return; } - tz->passive = 1; - allocate_power(tz, params->trip_max->temperature); + tz->passive = 1; } static struct thermal_governor thermal_gov_power_allocator = { |