From: Thorsten Blum <blum@kernel.org>
To: Amit Daniel Kachhap <amit.kachhap@gmail.com>,
Daniel Lezcano <daniel.lezcano@kernel.org>,
Viresh Kumar <viresh.kumar@linaro.org>,
Lukasz Luba <lukasz.luba@arm.com>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Zhang Rui <rui.zhang@intel.com>
Cc: Thorsten Blum <blum@kernel.org>,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] thermal/cpufreq_cooling: Simplify cpufreq_set_cur_state()
Date: Wed, 23 Sep 2026 22:29:13 +0200 [thread overview]
Message-ID: <20260923202911.90464-3-blum@kernel.org> (raw)
Return freq_qos_update_request() errors directly to simplify the code.
Signed-off-by: Thorsten Blum <blum@kernel.org>
---
drivers/thermal/cpufreq_cooling.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/thermal/cpufreq_cooling.c b/drivers/thermal/cpufreq_cooling.c
index 768859a7aed0..e89036077bef 100644
--- a/drivers/thermal/cpufreq_cooling.c
+++ b/drivers/thermal/cpufreq_cooling.c
@@ -488,12 +488,12 @@ static int cpufreq_set_cur_state(struct thermal_cooling_device *cdev,
frequency = get_state_freq(cpufreq_cdev, state);
ret = freq_qos_update_request(&cpufreq_cdev->qos_req, frequency);
- if (ret >= 0) {
- cpufreq_cdev->cpufreq_state = state;
- ret = 0;
- }
+ if (ret < 0)
+ return ret;
+
+ cpufreq_cdev->cpufreq_state = state;
- return ret;
+ return 0;
}
/**
next reply other threads:[~2026-09-23 20:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-23 20:29 Thorsten Blum [this message]
2026-09-25 20:14 ` [PATCH] thermal/cpufreq_cooling: Simplify cpufreq_set_cur_state() Rafael J. Wysocki (Intel)
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=20260923202911.90464-3-blum@kernel.org \
--to=blum@kernel.org \
--cc=amit.kachhap@gmail.com \
--cc=daniel.lezcano@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=lukasz.luba@arm.com \
--cc=rafael@kernel.org \
--cc=rui.zhang@intel.com \
--cc=viresh.kumar@linaro.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.