From patchwork Thu Apr 25 17:28:57 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 2489571 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork2.kernel.org (Postfix) with ESMTP id 6C112DF5B1 for ; Thu, 25 Apr 2013 18:28:32 +0000 (UTC) Received: from merlin.infradead.org ([205.233.59.134]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UVQAa-0007Se-C4; Thu, 25 Apr 2013 17:41:20 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UVPzv-0007DC-QL; Thu, 25 Apr 2013 17:30:19 +0000 Received: from moutng.kundenserver.de ([212.227.126.187]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UVPyo-00072I-9g for linux-arm-kernel@lists.infradead.org; Thu, 25 Apr 2013 17:29:18 +0000 Received: from wuerfel.lan (HSI-KBW-095-208-002-043.hsi5.kabel-badenwuerttemberg.de [95.208.2.43]) by mrelayeu.kundenserver.de (node=mrbap4) with ESMTP (Nemesis) id 0McnGz-1UDTSF2FP7-00HyMJ; Thu, 25 Apr 2013 19:29:06 +0200 From: Arnd Bergmann To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 14/21] cpufreq: pxa2xx: initialize variables Date: Thu, 25 Apr 2013 19:28:57 +0200 Message-Id: <1366910944-3033663-15-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1366910944-3033663-1-git-send-email-arnd@arndb.de> References: <1366910944-3033663-1-git-send-email-arnd@arndb.de> X-Provags-ID: V02:K0:RNsAitKC7QVnsEdtYQ1LvmqPqYylnR7QIpJwZqNPfRe hSWbXH8oCfQFDIh+stmG+lxeHfqHPxQZmHXyQlV2LPfVdyak95 ChnZQf1pBriEZH24oBVnBxBIZDzUnrWF5l3qEtHS/4r63nBCfC VFr50jqiUeZoDdh96NQWXHTKRYakymtLFQuO5cMq9n4wIuGf58 8al4NACDLj9/RL2o076IHJvyxf8BZbzQCTlxIgONqq9HkAoX/y myqp7oIT+kfl/LK4LtUif+0JkqqcZZX12j71oigy87xnSyJCkD OrY9oWMdHXz26OhVu3UNVAUx9nQfAoC74WRhxUb1HOr8EHFZZR qMA592DVjJQbQhqMVcCva9g2KU1vmWMMLesdwHsw9 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130425_132910_608551_0D061C74 X-CRM114-Status: GOOD ( 12.07 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [212.227.126.187 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Viresh Kumar , "Rafael J. Wysocki" , linux-kernel@vger.kernel.org, Arnd Bergmann X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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 Cc: Viresh Kumar Cc: Rafael J. Wysocki --- drivers/cpufreq/pxa2xx-cpufreq.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/cpufreq/pxa2xx-cpufreq.c b/drivers/cpufreq/pxa2xx-cpufreq.c index fe4c55b..9e5bc8e 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, *pxa_freqs = pxa255_turbo_freqs; *freq_table = pxa255_turbo_freq_table; } - } - if (cpu_is_pxa27x()) { + } else if (cpu_is_pxa27x()) { *pxa_freqs = pxa27x_freqs; *freq_table = pxa27x_freq_table; + } else { + BUG(); } }