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
  2026-09-25 20:14 ` Rafael J. Wysocki (Intel)
  0 siblings, 1 reply; 2+ messages 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] 2+ messages in thread

* Re: [PATCH] thermal/cpufreq_cooling: Simplify cpufreq_set_cur_state()
  2026-09-23 20:29 [PATCH] thermal/cpufreq_cooling: Simplify cpufreq_set_cur_state() Thorsten Blum
@ 2026-09-25 20:14 ` Rafael J. Wysocki (Intel)
  0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki (Intel) @ 2026-09-25 20:14 UTC (permalink / raw)
  To: Thorsten Blum
  Cc: Amit Daniel Kachhap, Daniel Lezcano, Viresh Kumar, Lukasz Luba,
	Rafael J. Wysocki, Zhang Rui, linux-pm, linux-kernel

On Wed, Sep 23, 2026 at 10:30 PM Thorsten Blum <blum@kernel.org> wrote:
>
> 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;
>  }
>
>  /**

Applied as 7.4 material, thanks!

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-09-25 20:16 UTC | newest]

Thread overview: 2+ messages (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
2026-09-25 20:14 ` Rafael J. Wysocki (Intel)

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®