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: 1083192 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p7L6XxpB027487 for ; Sun, 21 Aug 2011 06:33:59 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751110Ab1HUGd6 (ORCPT ); Sun, 21 Aug 2011 02:33:58 -0400 Received: from utopia.booyaka.com ([72.9.107.138]:59856 "EHLO utopia.booyaka.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750878Ab1HUGd6 (ORCPT ); Sun, 21 Aug 2011 02:33:58 -0400 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 cc: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Tony Lindgren , Felipe Balbi 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 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Sun, 21 Aug 2011 06:33:59 +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);