summaryrefslogtreecommitdiff
path: root/drivers/cpufreq/qcom-cpufreq-hw.c
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2020-07-30 08:59:40 +0530
committerViresh Kumar <viresh.kumar@linaro.org>2020-07-30 11:40:16 +0530
commit292072c38768bb2321cf643b27cdf8fd8282d028 (patch)
tree41b1cc43d5fe5eacc2c3ef5706de0af6256847b5 /drivers/cpufreq/qcom-cpufreq-hw.c
parentdf320f89359c0cc22ff552da3ffd07171f7754a6 (diff)
downloadlwn-292072c38768bb2321cf643b27cdf8fd8282d028.tar.gz
lwn-292072c38768bb2321cf643b27cdf8fd8282d028.zip
cpufreq: cached_resolved_idx can not be negative
It is not possible for cached_resolved_idx to be invalid here as the cpufreq core always sets index to a positive value. Change its type to unsigned int and fix qcom usage a bit. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Diffstat (limited to 'drivers/cpufreq/qcom-cpufreq-hw.c')
-rw-r--r--drivers/cpufreq/qcom-cpufreq-hw.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/cpufreq/qcom-cpufreq-hw.c b/drivers/cpufreq/qcom-cpufreq-hw.c
index fa68fa8ebd95..599818d38717 100644
--- a/drivers/cpufreq/qcom-cpufreq-hw.c
+++ b/drivers/cpufreq/qcom-cpufreq-hw.c
@@ -112,13 +112,10 @@ static unsigned int qcom_cpufreq_hw_fast_switch(struct cpufreq_policy *policy,
unsigned int target_freq)
{
void __iomem *perf_state_reg = policy->driver_data;
- int index;
+ unsigned int index;
unsigned long freq;
index = policy->cached_resolved_idx;
- if (index < 0)
- return 0;
-
writel_relaxed(index, perf_state_reg);
freq = policy->freq_table[index].frequency;