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>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user