All of lore.kernel.org
 help / color / mirror / Atom feed
From: Santosh Shilimkar <santosh.shilimkar@ti.com>
To: Jon Hunter <jon-hunter@ti.com>
Cc: Tony Lindgren <tony@atomide.com>,
	linux-omap <linux-omap@vger.kernel.org>,
	linux-arm <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 1/3] ARM: OMAP2+: Fix realtime_counter_init warning in timer.c
Date: Wed, 28 Nov 2012 11:39:56 +0530	[thread overview]
Message-ID: <50B5AAB4.9010103@ti.com> (raw)
In-Reply-To: <1354068915-3378-2-git-send-email-jon-hunter@ti.com>

[-- Attachment #1: Type: text/plain, Size: 3757 bytes --]

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 <santosh.shilimkar@ti.com>
>
> Reported-by: Tony Lindgren <tony@atomide.com>
> Signed-off-by: Jon Hunter <jon-hunter@ti.com>
> ---
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 <santosh.shilimkar@ti.com>
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 <jon-hunter@ti.com>

Reported-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
---
  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









[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-ARM-OMAP2-Fix-realtime_counter_init-warning-in-timer.patch --]
[-- Type: text/x-patch; name="0001-ARM-OMAP2-Fix-realtime_counter_init-warning-in-timer.patch", Size: 1797 bytes --]

>From e000aa13e47e29fbe3473bfd0277cb057c3160cc Mon Sep 17 00:00:00 2001
From: Santosh Shilimkar <santosh.shilimkar@ti.com>
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 <jon-hunter@ti.com>

Reported-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
---
 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


WARNING: multiple messages have this Message-ID (diff)
From: santosh.shilimkar@ti.com (Santosh Shilimkar)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/3] ARM: OMAP2+: Fix realtime_counter_init warning in timer.c
Date: Wed, 28 Nov 2012 11:39:56 +0530	[thread overview]
Message-ID: <50B5AAB4.9010103@ti.com> (raw)
In-Reply-To: <1354068915-3378-2-git-send-email-jon-hunter@ti.com>

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 <santosh.shilimkar@ti.com>
>
> Reported-by: Tony Lindgren <tony@atomide.com>
> Signed-off-by: Jon Hunter <jon-hunter@ti.com>
> ---
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 <santosh.shilimkar@ti.com>
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 <jon-hunter@ti.com>

Reported-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
---
  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








-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-ARM-OMAP2-Fix-realtime_counter_init-warning-in-timer.patch
Type: text/x-patch
Size: 1797 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20121128/18a565d1/attachment-0001.bin>

  reply	other threads:[~2012-11-28  6:09 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-28  2:15 [PATCH 0/3] ARM: OMAP2+: Timer build warnings and error fixes Jon Hunter
2012-11-28  2:15 ` Jon Hunter
2012-11-28  2:15 ` [PATCH 1/3] ARM: OMAP2+: Fix realtime_counter_init warning in timer.c Jon Hunter
2012-11-28  2:15   ` Jon Hunter
2012-11-28  6:09   ` Santosh Shilimkar [this message]
2012-11-28  6:09     ` Santosh Shilimkar
2012-11-28 15:47     ` Jon Hunter
2012-11-28 15:47       ` Jon Hunter
2012-11-28 15:55       ` Santosh Shilimkar
2012-11-28 15:55         ` Santosh Shilimkar
2012-11-28 16:01         ` Jon Hunter
2012-11-28 16:01           ` Jon Hunter
2012-11-28 16:06           ` Santosh Shilimkar
2012-11-28 16:06             ` Santosh Shilimkar
2012-11-28 16:04       ` Santosh Shilimkar
2012-11-28 16:04         ` Santosh Shilimkar
2012-11-28  2:15 ` [PATCH 2/3] ARM: OMAP4: Fix build error and " Jon Hunter
2012-11-28  2:15   ` Jon Hunter
2012-11-28  5:47   ` Santosh Shilimkar
2012-11-28  5:47     ` Santosh Shilimkar
2012-11-28  6:40   ` Igor Grinberg
2012-11-28  6:40     ` Igor Grinberg
2012-11-28  2:15 ` [PATCH 3/3] ARM: AM335x: Fix " Jon Hunter
2012-11-28  2:15   ` Jon Hunter
2012-11-28  6:28   ` Santosh Shilimkar
2012-11-28  6:28     ` Santosh Shilimkar
2012-11-28  6:46     ` Igor Grinberg
2012-11-28  6:46       ` Igor Grinberg
2012-11-28  7:20       ` Santosh Shilimkar
2012-11-28  7:20         ` Santosh Shilimkar
2012-11-28 16:06         ` Jon Hunter
2012-11-28 16:06           ` Jon Hunter
2012-11-28 10:21   ` Vaibhav Hiremath
2012-11-28 10:21     ` Vaibhav Hiremath

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50B5AAB4.9010103@ti.com \
    --to=santosh.shilimkar@ti.com \
    --cc=jon-hunter@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.