aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2013-04-25 13:28:57 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-04-25 14:11:14 -0400
commit7264a2bbb0a1d9935c653cb0e0cb48cfcaa87538 (patch)
tree9a72bd158b0b793a3a5a7364a9a9999d03468559 /drivers/cpufreq
parent5eed1987e23c6800050ec61706aeb393b0f0bc96 (diff)
cpufreq: pxa2xx: initialize variables
gcc-3.8 correctly found that the variables set by find_freq_tables() are not initialized if this function is called on something other than a pxa2xx or pxa3xx: pxa2xx-cpufreq.c: In function 'pxa_verify_policy': pxa2xx-cpufreq.c:272:6: warning: 'pxa_freqs_table' may be used uninitialized in this function [-Wmaybe-uninitialized] pxa2xx-cpufreq.c: In function 'pxa_set_target': pxa2xx-cpufreq.c:345:23: warning: 'pxa_freq_settings' may be used uninitialized in this function [-Wmaybe-uninitialized] Rather than adding a bogus initialization that would let us get a little further before crashing, add an explicit BUG(). We know that this code is designed to run on only these cpus, so this will fix the build warning and give a more helpful diagnostic if the code ever changes to run on other machines. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r--drivers/cpufreq/pxa2xx-cpufreq.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/cpufreq/pxa2xx-cpufreq.c b/drivers/cpufreq/pxa2xx-cpufreq.c
index fe4c55b38ec3..9e5bc8e388a0 100644
--- a/drivers/cpufreq/pxa2xx-cpufreq.c
+++ b/drivers/cpufreq/pxa2xx-cpufreq.c
@@ -221,10 +221,11 @@ static void find_freq_tables(struct cpufreq_frequency_table **freq_table,
221 *pxa_freqs = pxa255_turbo_freqs; 221 *pxa_freqs = pxa255_turbo_freqs;
222 *freq_table = pxa255_turbo_freq_table; 222 *freq_table = pxa255_turbo_freq_table;
223 } 223 }
224 } 224 } else if (cpu_is_pxa27x()) {
225 if (cpu_is_pxa27x()) {
226 *pxa_freqs = pxa27x_freqs; 225 *pxa_freqs = pxa27x_freqs;
227 *freq_table = pxa27x_freq_table; 226 *freq_table = pxa27x_freq_table;
227 } else {
228 BUG();
228 } 229 }
229} 230}
230 231