From patchwork Wed Nov 28 06:09:56 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Santosh Shilimkar X-Patchwork-Id: 1814141 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id A7055DF26F for ; Wed, 28 Nov 2012 06:12:26 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Tdaq5-00021J-NB; Wed, 28 Nov 2012 06:09:41 +0000 Received: from bear.ext.ti.com ([192.94.94.41]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Tdaq1-000201-GI for linux-arm-kernel@lists.infradead.org; Wed, 28 Nov 2012 06:09:38 +0000 Received: from dbdp20.itg.ti.com ([172.24.170.38]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id qAS69YL6015576; Wed, 28 Nov 2012 00:09:35 -0600 Received: from DBDE71.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id qAS69Wld021849; Wed, 28 Nov 2012 11:39:32 +0530 (IST) Received: from dbdp32.itg.ti.com (172.24.170.251) by DBDE71.ent.ti.com (172.24.170.149) with Microsoft SMTP Server id 14.1.323.3; Wed, 28 Nov 2012 11:39:32 +0530 Received: from [172.24.136.83] (smtpvbd.itg.ti.com [172.24.170.250]) by dbdp32.itg.ti.com (8.13.8/8.13.8) with ESMTP id qAS69UBY029403; Wed, 28 Nov 2012 11:39:30 +0530 Message-ID: <50B5AAB4.9010103@ti.com> Date: Wed, 28 Nov 2012 11:39:56 +0530 From: Santosh Shilimkar User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Jon Hunter Subject: Re: [PATCH 1/3] ARM: OMAP2+: Fix realtime_counter_init warning in timer.c References: <1354068915-3378-1-git-send-email-jon-hunter@ti.com> <1354068915-3378-2-git-send-email-jon-hunter@ti.com> In-Reply-To: <1354068915-3378-2-git-send-email-jon-hunter@ti.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121128_010937_720492_5A551389 X-CRM114-Status: GOOD ( 24.87 ) X-Spam-Score: -7.6 (-------) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-7.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [192.94.94.41 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.7 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Tony Lindgren , linux-omap , linux-arm X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 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 On Wednesday 28 November 2012 07:45 AM, Jon Hunter wrote: > In commit fa6d79d (ARM: OMAP: Add initialisation for the real-time > counter), the function realtime_counter_init() was added. However, if > the kernel configuration option CONFIG_SOC_OMAP5 is not selected then > the following compiler warning is observed. > > CC arch/arm/mach-omap2/timer.o > arch/arm/mach-omap2/timer.c:489:20: warning: ‘realtime_counter_init’ > defined but not used [-Wunused-function] > > Commit fa6d79d also introduced the kernel configuration option > CONFIG_SOC_HAS_REALTIME_COUNTER. If this option is not selected then the > a stub function for realtime_counter_init() is defined. > > The option CONFIG_SOC_HAS_REALTIME_COUNTER and stub function are not > really needed because ... > > 1. For non-OMAP5 devices, there is no realtime counter and so > realtime_counter_init() function is not used. > 2. For OMAP5 devices, CONFIG_SOC_HAS_REALTIME_COUNTER is always selected > and cannot be disabled, so the stub function for realtime_counter_init() > is never used. > > Fix this warning by removing the kernel configuration option > CONFIG_SOC_HAS_REALTIME_COUNTER and stub function, and only include > the function realtime_counter_init() if CONFIG_SOC_OMAP5 is selected. > > Cc: Santosh Shilimkar > > Reported-by: Tony Lindgren > Signed-off-by: Jon Hunter > --- The #ifdef was avoided because the real-time counter can be used on other future SOCs. And the those SOCs just select SOC_HAS_REALTIME_COUNTER. And that stub was added because OMAP5 can work without real-time counter configuration enabled using 32K counter. But since we are any way have that SOC_HAS_REALTIME_COUNTER always set for SOC which wants to use it, we can actually remove the stub and hence avoid the warning. Let me know if below patch is ok with you ? attached the same for mailer issues From e000aa13e47e29fbe3473bfd0277cb057c3160cc Mon Sep 17 00:00:00 2001 From: Santosh Shilimkar Date: Wed, 28 Nov 2012 11:28:57 +0530 Subject: [PATCH] ARM: OMAP2+: Fix realtime_counter_init warning in timer.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In commit fa6d79d (ARM: OMAP: Add initialisation for the real-time counter), the function realtime_counter_init() was added. However, if the kernel configuration option CONFIG_SOC_OMAP5 is not selected then the following compiler warning is observed. CC arch/arm/mach-omap2/timer.o arch/arm/mach-omap2/timer.c:489:20: warning: ‘realtime_counter_init’ defined but not used [-Wunused-function] It is because of the stub init function which was added for the cases where realtime_counter_init() is called with !CONFIG_SOC_HAS_REALTIME_COUNTER. This is actually not necessary since the SOC which need this feature will explicitly select the configuration. So just drop the unused stub to avoid the build warning. Patch is made after seeing Jon's patch which was wrapping the real-time counter code under needed SOC #ifdef Cc: Jon Hunter Reported-by: Tony Lindgren Signed-off-by: Santosh Shilimkar --- arch/arm/mach-omap2/timer.c | 3 --- 1 file changed, 3 deletions(-) From e000aa13e47e29fbe3473bfd0277cb057c3160cc Mon Sep 17 00:00:00 2001 From: Santosh Shilimkar Date: Wed, 28 Nov 2012 11:28:57 +0530 Subject: [PATCH] ARM: OMAP2+: Fix realtime_counter_init warning in timer.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In commit fa6d79d (ARM: OMAP: Add initialisation for the real-time counter), the function realtime_counter_init() was added. However, if the kernel configuration option CONFIG_SOC_OMAP5 is not selected then the following compiler warning is observed. CC arch/arm/mach-omap2/timer.o arch/arm/mach-omap2/timer.c:489:20: warning: ‘realtime_counter_init’ defined but not used [-Wunused-function] It is because of the stub init function which was added for the cases where realtime_counter_init() is called with !CONFIG_SOC_HAS_REALTIME_COUNTER. This is actually not necessary since the SOC which need this feature will explicitly select the configuration. So just drop the unused stub to avoid the build warning. Patch is made after seeing Jon's patch which was wrapping the real-time counter code under needed SOC #ifdef Cc: Jon Hunter Reported-by: Tony Lindgren Signed-off-by: Santosh Shilimkar --- arch/arm/mach-omap2/timer.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c index 69e4663..79d8e6b 100644 --- a/arch/arm/mach-omap2/timer.c +++ b/arch/arm/mach-omap2/timer.c @@ -428,9 +428,6 @@ static void __init realtime_counter_init(void) iounmap(base); } -#else -static inline void __init realtime_counter_init(void) -{} #endif #define OMAP_SYS_TIMER_INIT(name, clkev_nr, clkev_src, \ -- 1.7.9.5