Re: [PATCH] thermal/cpufreq_cooling: Simplify cpufreq_set_cur_state()

From: Rafael J. Wysocki (Intel)

Date: Fri Sep 25 2026 - 16:22:39 EST


On Wed, Sep 23, 2026 at 10:30 PM Thorsten Blum <blum@xxxxxxxxxx> wrote:
>
> Return freq_qos_update_request() errors directly to simplify the code.
>
> Signed-off-by: Thorsten Blum <blum@xxxxxxxxxx>
> ---
> 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!