Skip to content

Commit

Permalink
thermal: gov_power_allocator: Use shorter paths to access data when p…
Browse files Browse the repository at this point in the history
…ossible

The 'cdev' pointer in allow_maximum_power() is valid, so there is no
need to use 'instance->cdev' instead of it.

This change is not expected to alter the general functionality.

Signed-off-by: Lukasz Luba <lukasz.luba@arm.com>
[ rjw: Subject and changelog edits ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Lukasz Luba authored and Rafael J. Wysocki committed Nov 28, 2023
1 parent 499cc39 commit 30e1178
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/thermal/gov_power_allocator.c
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ static void allow_maximum_power(struct thermal_zone_device *tz, bool update)
continue;

instance->target = 0;
mutex_lock(&instance->cdev->lock);
mutex_lock(&cdev->lock);
/*
* Call for updating the cooling devices local stats and avoid
* periods of dozen of seconds when those have not been
Expand All @@ -569,9 +569,9 @@ static void allow_maximum_power(struct thermal_zone_device *tz, bool update)
cdev->ops->get_requested_power(cdev, &req_power);

if (update)
__thermal_cdev_update(instance->cdev);
__thermal_cdev_update(cdev);

mutex_unlock(&instance->cdev->lock);
mutex_unlock(&cdev->lock);
}
}

Expand Down

0 comments on commit 30e1178

Please sign in to comment.