diff options
author | Axel Lin <axel.lin@gmail.com> | 2011-11-04 08:04:41 -0400 |
---|---|---|
committer | Dave Jones <davej@redhat.com> | 2011-11-11 22:28:33 -0500 |
commit | eb0b38a5d2c063cd8dc9e44415ce08e30d95f571 (patch) | |
tree | 59002baad22e0f8f5ba2a6b8d652c591798780b9 /drivers/cpufreq | |
parent | 8f042aa75afccc45c5b60517f51644bce3f52545 (diff) |
[CPUFREQ] db8500: fix build error due to undeclared i variable
The variable i is removed by commit ded8433
"[CPUFREQ] db8500: remove unneeded for loop iteration over freq_table",
but current code to print available frequencies still uses the i variable.
Thus add the i variable back to fix below buld error:
CC drivers/cpufreq/db8500-cpufreq.o
drivers/cpufreq/db8500-cpufreq.c: In function 'db8500_cpufreq_init':
drivers/cpufreq/db8500-cpufreq.c:123: error: 'i' undeclared (first use in this function)
drivers/cpufreq/db8500-cpufreq.c:123: error: (Each undeclared identifier is reported only once
drivers/cpufreq/db8500-cpufreq.c:123: error: for each function it appears in.)
make[2]: *** [drivers/cpufreq/db8500-cpufreq.o] Error 1
make[1]: *** [drivers/cpufreq] Error 2
make: *** [drivers] Error 2
This patch also fixes using uninitialized i variable as array index.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Dave Jones <davej@redhat.com>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r-- | drivers/cpufreq/db8500-cpufreq.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/cpufreq/db8500-cpufreq.c b/drivers/cpufreq/db8500-cpufreq.c index edaa987621ea..f5002015d82e 100644 --- a/drivers/cpufreq/db8500-cpufreq.c +++ b/drivers/cpufreq/db8500-cpufreq.c | |||
@@ -109,7 +109,7 @@ static unsigned int db8500_cpufreq_getspeed(unsigned int cpu) | |||
109 | 109 | ||
110 | static int __cpuinit db8500_cpufreq_init(struct cpufreq_policy *policy) | 110 | static int __cpuinit db8500_cpufreq_init(struct cpufreq_policy *policy) |
111 | { | 111 | { |
112 | int res; | 112 | int i, res; |
113 | 113 | ||
114 | BUILD_BUG_ON(ARRAY_SIZE(idx2opp) + 1 != ARRAY_SIZE(freq_table)); | 114 | BUILD_BUG_ON(ARRAY_SIZE(idx2opp) + 1 != ARRAY_SIZE(freq_table)); |
115 | 115 | ||
@@ -120,8 +120,8 @@ static int __cpuinit db8500_cpufreq_init(struct cpufreq_policy *policy) | |||
120 | freq_table[3].frequency = 1000000; | 120 | freq_table[3].frequency = 1000000; |
121 | } | 121 | } |
122 | pr_info("db8500-cpufreq : Available frequencies:\n"); | 122 | pr_info("db8500-cpufreq : Available frequencies:\n"); |
123 | while (freq_table[i].frequency != CPUFREQ_TABLE_END) | 123 | for (i = 0; freq_table[i].frequency != CPUFREQ_TABLE_END; i++) |
124 | pr_info(" %d Mhz\n", freq_table[i++].frequency/1000); | 124 | pr_info(" %d Mhz\n", freq_table[i].frequency/1000); |
125 | 125 | ||
126 | /* get policy fields based on the table */ | 126 | /* get policy fields based on the table */ |
127 | res = cpufreq_frequency_table_cpuinfo(policy, freq_table); | 127 | res = cpufreq_frequency_table_cpuinfo(policy, freq_table); |