Linux Power Management development
 help / color / mirror / Atom feed
From: Steve Muckle <steve.muckle@linaro.org>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Rafael Wysocki <rjw@rjwysocki.net>,
	linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org
Subject: Re: [PATCH] cpufreq: Fix incorrect usage of clamp_val()
Date: Tue, 31 May 2016 11:23:08 -0700	[thread overview]
Message-ID: <20160531182308.GJ9864@graphite.smuckle.net> (raw)
In-Reply-To: <a5c21ebe773d364b49bc5df9c4f69ff2eb181dbb.1464693539.git.viresh.kumar@linaro.org>

On Tue, May 31, 2016 at 04:49:42PM +0530, Viresh Kumar wrote:
> clamp_val() doesn't change anything by itself, rather it returns the
> clamped value.
> 
> Fix it.
> 
> Fixes: 0ac587b32f49 ("cpufreq: Use clamp_val() in __cpufreq_driver_target()")
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
> ---
> Hi Rafael,
> 
> Please merge this with the offending commit if you are fine with rebase,
> else apply this one as well.
> 
> Sorry for blindly copying code.
> 
>  drivers/cpufreq/cpufreq.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
> index d0c02a7eec0f..c6a14ba239a2 100644
> --- a/drivers/cpufreq/cpufreq.c
> +++ b/drivers/cpufreq/cpufreq.c
> @@ -1927,7 +1927,7 @@ int __cpufreq_driver_target(struct cpufreq_policy *policy,
>  		return -ENODEV;
>  
>  	/* Make sure that target_freq is within supported range */
> -	clamp_val(target_freq, policy->min, policy->max);
> +	target_freq = clamp_val(target_freq, policy->min, policy->max);
>  
>  	pr_debug("target for CPU %u: %u kHz, relation %u, requested %u kHz\n",
>  		 policy->cpu, target_freq, relation, old_target_freq);

As mentioned in the other thread cpufreq_driver_fast_switch() has this
problem as well, might as well fix it in this patch also.

thanks,
Steve

  reply	other threads:[~2016-05-31 18:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-31 11:19 [PATCH] cpufreq: Fix incorrect usage of clamp_val() Viresh Kumar
2016-05-31 18:23 ` Steve Muckle [this message]
2016-05-31 20:46   ` Rafael J. Wysocki
2016-06-01  1:32     ` Viresh Kumar
2016-05-31 20:44 ` 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=20160531182308.GJ9864@graphite.smuckle.net \
    --to=steve.muckle@linaro.org \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox