mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] thermal/cpufreq_cooling: Simplify cpufreq_set_cur_state()
@ 2026-09-23 20:29 Thorsten Blum
  0 siblings, 0 replies; only message in thread
From: Thorsten Blum @ 2026-09-23 20:29 UTC (permalink / raw)
  To: Amit Daniel Kachhap, Daniel Lezcano, Viresh Kumar, Lukasz Luba,
	Rafael J. Wysocki, Zhang Rui
  Cc: Thorsten Blum, linux-pm, linux-kernel

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;
 }
 
 /**

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-09-23 20:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-23 20:29 [PATCH] thermal/cpufreq_cooling: Simplify cpufreq_set_cur_state() Thorsten Blum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®