From: "Rafael J. Wysocki" <rafael@kernel.org>
To: Linux PM <linux-pm@vger.kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
Lukasz Luba <lukasz.luba@arm.com>,
Daniel Lezcano <daniel.lezcano@linaro.org>
Subject: [PATCH v2 1/3] thermal: gov_step_wise: Clean up local variable initialization
Date: Mon, 25 Aug 2025 15:27:46 +0200 [thread overview]
Message-ID: <6203592.lOV4Wx5bFT@rafael.j.wysocki> (raw)
In-Reply-To: <12745610.O9o76ZdvQC@rafael.j.wysocki>
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
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>
---
drivers/thermal/gov_step_wise.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
--- a/drivers/thermal/gov_step_wise.c
+++ b/drivers/thermal/gov_step_wise.c
@@ -69,16 +69,14 @@
const struct thermal_trip_desc *td,
int trip_threshold)
{
+ bool throttle = tz->temperature >= trip_threshold;
const struct thermal_trip *trip = &td->trip;
enum thermal_trend trend = get_tz_trend(tz, trip);
int trip_id = thermal_zone_trip_id(tz, trip);
struct thermal_instance *instance;
- bool throttle = false;
- if (tz->temperature >= trip_threshold) {
- throttle = true;
+ if (throttle)
trace_thermal_zone_trip(tz, trip_id, trip->type);
- }
dev_dbg(&tz->device, "Trip%d[type=%d,temp=%d]:trend=%d,throttle=%d\n",
trip_id, trip->type, trip_threshold, trend, throttle);
next prev parent reply other threads:[~2025-08-25 13:32 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-25 13:26 [PATCH v2 0/3] thermal: gov_step_wise: Two cleanups and small adjustment Rafael J. Wysocki
2025-08-25 13:27 ` Rafael J. Wysocki [this message]
2025-09-04 7:21 ` [PATCH v2 1/3] thermal: gov_step_wise: Clean up local variable initialization Lukasz Luba
2025-08-25 13:28 ` [PATCH v2 2/3] thermal: gov_step_wise: Clarify cooling logic description comment Rafael J. Wysocki
2025-09-04 7:22 ` Lukasz Luba
2025-08-25 13:31 ` [PATCH v2 3/3] thermal: gov_step_wise: Allow cooling level to be reduced earlier Rafael J. Wysocki
2025-09-04 7:32 ` Lukasz Luba
2025-09-04 13:25 ` Rafael J. Wysocki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6203592.lOV4Wx5bFT@rafael.j.wysocki \
--to=rafael@kernel.org \
--cc=daniel.lezcano@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=lukasz.luba@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox