Skip to content

Commit 28cef16

Browse files
committed
thermal: gov_step_wise: Clean up local variable initialization
Make the initialization of local variable throttle in thermal_zone_trip_update() more straightforward. No intentional functional impact. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Lukasz Luba <lukasz.luba@arm.com> Link: https://patch.msgid.link/6203592.lOV4Wx5bFT@rafael.j.wysocki
1 parent b320789 commit 28cef16

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/thermal/gov_step_wise.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,14 @@ static void thermal_zone_trip_update(struct thermal_zone_device *tz,
6969
const struct thermal_trip_desc *td,
7070
int trip_threshold)
7171
{
72+
bool throttle = tz->temperature >= trip_threshold;
7273
const struct thermal_trip *trip = &td->trip;
7374
enum thermal_trend trend = get_tz_trend(tz, trip);
7475
int trip_id = thermal_zone_trip_id(tz, trip);
7576
struct thermal_instance *instance;
76-
bool throttle = false;
7777

78-
if (tz->temperature >= trip_threshold) {
79-
throttle = true;
78+
if (throttle)
8079
trace_thermal_zone_trip(tz, trip_id, trip->type);
81-
}
8280

8381
dev_dbg(&tz->device, "Trip%d[type=%d,temp=%d]:trend=%d,throttle=%d\n",
8482
trip_id, trip->type, trip_threshold, trend, throttle);

0 commit comments

Comments
 (0)