diff mbox

cpufreq, intel_pstate, minor cleanup for FRAC_BITS

Message ID 1449600299-4647-1-git-send-email-prarit@redhat.com (mailing list archive)
State Accepted, archived
Delegated to: Rafael Wysocki
Headers show

Commit Message

Prarit Bhargava Dec. 8, 2015, 6:44 p.m. UTC
785ee27 ("cpufreq: intel_pstate: Fix limits->max_perf rounding error")
hardcodes the value of FRAC_BITS.  This patch fixes that minor issue.

Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: Len Brown <lenb@kernel.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Prarit Bhargava <prarit@redhat.com>
---
 drivers/cpufreq/intel_pstate.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Viresh Kumar Dec. 9, 2015, 1:53 a.m. UTC | #1
On 08-12-15, 13:44, Prarit Bhargava wrote:
> 785ee27 ("cpufreq: intel_pstate: Fix limits->max_perf rounding error")
> hardcodes the value of FRAC_BITS.  This patch fixes that minor issue.
> 
> Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
> Cc: Len Brown <lenb@kernel.org>
> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> Cc: Viresh Kumar <viresh.kumar@linaro.org>
> Signed-off-by: Prarit Bhargava <prarit@redhat.com>
> ---
>  drivers/cpufreq/intel_pstate.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
> index 4d07cbd..98fb882 100644
> --- a/drivers/cpufreq/intel_pstate.c
> +++ b/drivers/cpufreq/intel_pstate.c
> @@ -1123,7 +1123,7 @@ static int intel_pstate_set_policy(struct cpufreq_policy *policy)
>  				   limits->max_sysfs_pct);
>  	limits->max_perf_pct = max(limits->min_policy_pct,
>  				   limits->max_perf_pct);
> -	limits->max_perf = round_up(limits->max_perf, 8);
> +	limits->max_perf = round_up(limits->max_perf, FRAC_BITS);
>  
>  	/* Make sure min_perf_pct <= max_perf_pct */
>  	limits->min_perf_pct = min(limits->max_perf_pct, limits->min_perf_pct);

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Rafael J. Wysocki Dec. 12, 2015, 2:27 a.m. UTC | #2
On Tuesday, December 08, 2015 01:44:59 PM Prarit Bhargava wrote:
> 785ee27 ("cpufreq: intel_pstate: Fix limits->max_perf rounding error")
> hardcodes the value of FRAC_BITS.  This patch fixes that minor issue.
> 
> Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
> Cc: Len Brown <lenb@kernel.org>
> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> Cc: Viresh Kumar <viresh.kumar@linaro.org>
> Signed-off-by: Prarit Bhargava <prarit@redhat.com>

Applied, thanks!

Rafael

--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index 4d07cbd..98fb882 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -1123,7 +1123,7 @@  static int intel_pstate_set_policy(struct cpufreq_policy *policy)
 				   limits->max_sysfs_pct);
 	limits->max_perf_pct = max(limits->min_policy_pct,
 				   limits->max_perf_pct);
-	limits->max_perf = round_up(limits->max_perf, 8);
+	limits->max_perf = round_up(limits->max_perf, FRAC_BITS);
 
 	/* Make sure min_perf_pct <= max_perf_pct */
 	limits->min_perf_pct = min(limits->max_perf_pct, limits->min_perf_pct);