diff options
author | Tushar Behera <tushar.behera@linaro.org> | 2012-03-15 14:35:31 +0530 |
---|---|---|
committer | Tushar Behera <tushar.behera@linaro.org> | 2012-03-15 14:41:49 +0530 |
commit | a57e8930ef7df2eda598ae1ff265cf694831fc0f (patch) | |
tree | cf42203c6b0052f3d2921c48c1106fb03f4c3391 | |
parent | cff8a6450f0d7c3d15b3d0fa6f6ac5dc8601a75b (diff) |
ARM: EXYNOS: Fix array index typo in cpufreq driverlinux-3.3-rc5-2012.03
The index to compare should be i.
While at it, also fix a compilation warning.
drivers/cpufreq/exynos-cpufreq.c: In function ‘exynos_target’:
drivers/cpufreq/exynos-cpufreq.c:89:36: warning: ‘old_index’ may be
used uninitialized in this function [-Wuninitialized]
Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
-rw-r--r-- | drivers/cpufreq/exynos-cpufreq.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/cpufreq/exynos-cpufreq.c b/drivers/cpufreq/exynos-cpufreq.c index 79bb6f17b94b..a8bbc54a8b56 100644 --- a/drivers/cpufreq/exynos-cpufreq.c +++ b/drivers/cpufreq/exynos-cpufreq.c @@ -48,7 +48,7 @@ static int exynos_target(struct cpufreq_policy *policy, unsigned int target_freq, unsigned int relation) { - unsigned int index, old_index, i; + unsigned int index, old_index = 0, i; unsigned int arm_volt, safe_arm_volt = 0; int ret = 0; struct cpufreq_frequency_table *freq_table = exynos_info->freq_table; @@ -65,7 +65,7 @@ static int exynos_target(struct cpufreq_policy *policy, } for (i = 0; (freq_table[i].frequency != CPUFREQ_TABLE_END); i++) { - if (freqs.old == freq_table[old_index].frequency) { + if (freqs.old == freq_table[i].frequency) { old_index = i; break; } |