From patchwork Sun Aug 21 06:33:57 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Walmsley X-Patchwork-Id: 1083202 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p7L6YB1T008048 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sun, 21 Aug 2011 06:34:32 GMT Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Qv1bd-0001uZ-CV; Sun, 21 Aug 2011 06:34:01 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Qv1bc-0007Cr-UP; Sun, 21 Aug 2011 06:34:00 +0000 Received: from utopia.booyaka.com ([72.9.107.138]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Qv1ba-0007CY-8K for linux-arm-kernel@lists.infradead.org; Sun, 21 Aug 2011 06:33:58 +0000 Received: (qmail 30668 invoked by uid 1019); 21 Aug 2011 06:33:57 -0000 Date: Sun, 21 Aug 2011 00:33:57 -0600 (MDT) From: Paul Walmsley To: Bjarne Steinsbo Subject: Re: [PATCHv2 1/4] OMAP4: clockdata: Make compiler shut up about possible uninitialized variable In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110821_023358_367773_A04F4DDE X-CRM114-Status: GOOD ( 16.34 ) X-Spam-Score: -1.0 (-) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-1.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain Cc: Tony Lindgren , linux-omap@vger.kernel.org, Felipe Balbi , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Sun, 21 Aug 2011 06:34:32 +0000 (UTC) Hello Bjarne, On Fri, 12 Aug 2011, Bjarne Steinsbo wrote: > Stop `warning: 'cpu_clkflg' may be used uninitialized in this > function' from compiler. > > Signed-off-by: Bjarne Steinsbo Thanks for the patch. The following patch seems to make a little more sense to me, I think Tony wants the clock init routines to be initcalls eventually. - Paul From: Paul Walmsley Date: Sun, 21 Aug 2011 00:28:56 -0600 Subject: [PATCH] OMAP4: clock: fix compile warning Fix the following compile warning: arch/arm/mach-omap2/clock44xx_data.c: In function 'omap4xxx_clk_init': arch/arm/mach-omap2/clock44xx_data.c:3371:6: warning: 'cpu_clkflg' may be used uninitialized in this function The approach taken here is intended to work if omap4xxx_clk_init() is converted into an initcall. Thanks to Bjarne Steinsbo for proposing another approach. Signed-off-by: Paul Walmsley Cc: Bjarne Steinsbo --- arch/arm/mach-omap2/clock44xx_data.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-omap2/clock44xx_data.c b/arch/arm/mach-omap2/clock44xx_data.c index 2af0e3f..4304768 100644 --- a/arch/arm/mach-omap2/clock44xx_data.c +++ b/arch/arm/mach-omap2/clock44xx_data.c @@ -3376,6 +3376,8 @@ int __init omap4xxx_clk_init(void) } else if (cpu_is_omap446x()) { cpu_mask = RATE_IN_4460; cpu_clkflg = CK_446X; + } else { + return 0; } clk_init(&omap2_clk_functions);