* [PATCH 0/3] ARM: OMAP2+: Timer build warnings and error fixes
@ 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
` (2 more replies)
0 siblings, 3 replies; 17+ messages in thread
From: Jon Hunter @ 2012-11-28 2:15 UTC (permalink / raw)
To: linux-arm-kernel
Fixes for build warnings and errors seen with various kernel
configuration combinations.
Jon Hunter (3):
ARM: OMAP2+: Fix realtime_counter_init warning in timer.c
ARM: OMAP4: Fix build error and warning in timer.c
ARM: AM335x: Fix warning in timer.c
arch/arm/mach-omap2/Kconfig | 4 ----
arch/arm/mach-omap2/timer.c | 12 ++++++------
2 files changed, 6 insertions(+), 10 deletions(-)
--
1.7.10.4
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 1/3] ARM: OMAP2+: Fix realtime_counter_init warning in timer.c
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 6:09 ` Santosh Shilimkar
2012-11-28 2:15 ` [PATCH 2/3] ARM: OMAP4: Fix build error and " Jon Hunter
2012-11-28 2:15 ` [PATCH 3/3] ARM: AM335x: Fix " Jon Hunter
2 siblings, 1 reply; 17+ messages in thread
From: Jon Hunter @ 2012-11-28 2:15 UTC (permalink / raw)
To: linux-arm-kernel
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>
---
arch/arm/mach-omap2/Kconfig | 4 ----
arch/arm/mach-omap2/timer.c | 7 ++-----
2 files changed, 2 insertions(+), 9 deletions(-)
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 813c267..ea88b7d 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -24,9 +24,6 @@ config ARCH_OMAP2PLUS_TYPICAL
config SOC_HAS_OMAP2_SDRC
bool "OMAP2 SDRAM Controller support"
-config SOC_HAS_REALTIME_COUNTER
- bool "Real time free running counter"
-
config ARCH_OMAP2
bool "TI OMAP2"
depends on ARCH_OMAP2PLUS
@@ -79,7 +76,6 @@ config SOC_OMAP5
select ARM_GIC
select CPU_V7
select HAVE_SMP
- select SOC_HAS_REALTIME_COUNTER
select COMMON_CLK
comment "OMAP Core Type"
diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index b9cff72..a9f99e3 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -476,7 +476,7 @@ static void __init omap2_gptimer_clocksource_init(int gptimer_id,
gptimer_id, clksrc.rate);
}
-#ifdef CONFIG_SOC_HAS_REALTIME_COUNTER
+#ifdef CONFIG_SOC_OMAP5
/*
* The realtime counter also called master counter, is a free-running
* counter, which is related to real time. It produces the count used
@@ -549,10 +549,7 @@ static void __init realtime_counter_init(void)
iounmap(base);
}
-#else
-static inline void __init realtime_counter_init(void)
-{}
-#endif
+#endif /* CONFIG_SOC_OMAP5 */
#define OMAP_SYS_GP_TIMER_INIT(name, clkev_nr, clkev_src, clkev_prop, \
clksrc_nr, clksrc_src) \
--
1.7.10.4
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 2/3] ARM: OMAP4: Fix build error and warning in timer.c
2012-11-28 2:15 [PATCH 0/3] ARM: OMAP2+: Timer build warnings and error fixes 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 5:47 ` Santosh Shilimkar
2012-11-28 6:40 ` Igor Grinberg
2012-11-28 2:15 ` [PATCH 3/3] ARM: AM335x: Fix " Jon Hunter
2 siblings, 2 replies; 17+ messages in thread
From: Jon Hunter @ 2012-11-28 2:15 UTC (permalink / raw)
To: linux-arm-kernel
When compiling the kernel with configuration option CONFIG_ARCH_OMAP4
enabled and CONFIG_LOCAL_TIMERS disabled, the following build error and
warning is seen.
CC arch/arm/mach-omap2/timer.o
arch/arm/mach-omap2/timer.c: In function ?omap4_local_timer_init?:
arch/arm/mach-omap2/timer.c:630:2: error: implicit declaration of
function ?omap4_sync32_timer_init?
[-Werror=implicit-function-declaration]
arch/arm/mach-omap2/timer.c: At top level:
arch/arm/mach-omap2/timer.c:607:1: warning: ?omap4_sync32k_timer_init?
defined but not used [-Wunused-function]
cc1: some warnings being treated as errors
make[1]: *** [arch/arm/mach-omap2/timer.o] Error 1
This issue was introduced by commit 6f80b3b (ARM: OMAP2+: timer: remove
CONFIG_OMAP_32K_TIMER) where the "k" is missing from the "sync32k" in
the function name "omap4_sync32_timer_init". Therefore, correct this
typo to resolve the above error and warning.
Cc: Igor Grinberg <grinberg@compulab.co.il>
Reported-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Jon Hunter <jon-hunter@ti.com>
---
arch/arm/mach-omap2/timer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index a9f99e3..eb96712 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -627,7 +627,7 @@ static void __init omap4_local_timer_init(void)
#else /* CONFIG_LOCAL_TIMERS */
static inline void omap4_local_timer_init(void)
{
- omap4_sync32_timer_init();
+ omap4_sync32k_timer_init();
}
#endif /* CONFIG_LOCAL_TIMERS */
OMAP_SYS_TIMER(4, local);
--
1.7.10.4
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 3/3] ARM: AM335x: Fix warning in timer.c
2012-11-28 2:15 [PATCH 0/3] ARM: OMAP2+: Timer build warnings and error fixes 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 ` [PATCH 2/3] ARM: OMAP4: Fix build error and " Jon Hunter
@ 2012-11-28 2:15 ` Jon Hunter
2012-11-28 6:28 ` Santosh Shilimkar
2012-11-28 10:21 ` Vaibhav Hiremath
2 siblings, 2 replies; 17+ messages in thread
From: Jon Hunter @ 2012-11-28 2:15 UTC (permalink / raw)
To: linux-arm-kernel
When compiling the kernel with configuration options ...
# CONFIG_ARCH_OMAP2 is not set
# CONFIG_ARCH_OMAP3 is not set
# CONFIG_ARCH_OMAP4 is not set
# CONFIG_SOC_OMAP5 is not set
CONFIG_SOC_AM33XX=y
... the following build warning is seen.
CC arch/arm/mach-omap2/timer.o
arch/arm/mach-omap2/timer.c:395:19: warning: ?omap2_sync32k_clocksource_init?
defined but not used [-Wunused-function]
This issue was introduced by commit 6f80b3b (ARM: OMAP2+: timer: remove
CONFIG_OMAP_32K_TIMER) where the omap2_sync32k_clocksource_init() is no
longer referenced by the timer initialisation function for the AM335x
device as it has no 32k-sync timer.
Fix this by only including the omap2_sync32k_clocksource_init() function
if either OMAP2, OMAP3, OMAP4 or OMAP5 devices are enabled.
Cc: Igor Grinberg <grinberg@compulab.co.il>
Signed-off-by: Jon Hunter <jon-hunter@ti.com>
---
arch/arm/mach-omap2/timer.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index eb96712..085c7e7 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -386,6 +386,8 @@ static u32 notrace dmtimer_read_sched_clock(void)
return 0;
}
+#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) || \
+ defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5)
static struct of_device_id omap_counter_match[] __initdata = {
{ .compatible = "ti,omap-counter32k", },
{ }
@@ -451,6 +453,7 @@ static int __init omap2_sync32k_clocksource_init(void)
return ret;
}
+#endif
static void __init omap2_gptimer_clocksource_init(int gptimer_id,
const char *fck_source)
--
1.7.10.4
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 2/3] ARM: OMAP4: Fix build error and warning in timer.c
2012-11-28 2:15 ` [PATCH 2/3] ARM: OMAP4: Fix build error and " Jon Hunter
@ 2012-11-28 5:47 ` Santosh Shilimkar
2012-11-28 6:40 ` Igor Grinberg
1 sibling, 0 replies; 17+ messages in thread
From: Santosh Shilimkar @ 2012-11-28 5:47 UTC (permalink / raw)
To: linux-arm-kernel
On Wednesday 28 November 2012 07:45 AM, Jon Hunter wrote:
> When compiling the kernel with configuration option CONFIG_ARCH_OMAP4
> enabled and CONFIG_LOCAL_TIMERS disabled, the following build error and
> warning is seen.
>
> CC arch/arm/mach-omap2/timer.o
> arch/arm/mach-omap2/timer.c: In function ?omap4_local_timer_init?:
> arch/arm/mach-omap2/timer.c:630:2: error: implicit declaration of
> function ?omap4_sync32_timer_init?
> [-Werror=implicit-function-declaration]
> arch/arm/mach-omap2/timer.c: At top level:
> arch/arm/mach-omap2/timer.c:607:1: warning: ?omap4_sync32k_timer_init?
> defined but not used [-Wunused-function]
> cc1: some warnings being treated as errors
> make[1]: *** [arch/arm/mach-omap2/timer.o] Error 1
>
> This issue was introduced by commit 6f80b3b (ARM: OMAP2+: timer: remove
> CONFIG_OMAP_32K_TIMER) where the "k" is missing from the "sync32k" in
> the function name "omap4_sync32_timer_init". Therefore, correct this
> typo to resolve the above error and warning.
>
> Cc: Igor Grinberg <grinberg@compulab.co.il>
>
> Reported-by: Tony Lindgren <tony@atomide.com>
> Signed-off-by: Jon Hunter <jon-hunter@ti.com>
> ---
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 1/3] ARM: OMAP2+: Fix realtime_counter_init warning in timer.c
2012-11-28 2:15 ` [PATCH 1/3] ARM: OMAP2+: Fix realtime_counter_init warning in timer.c Jon Hunter
@ 2012-11-28 6:09 ` Santosh Shilimkar
2012-11-28 15:47 ` Jon Hunter
0 siblings, 1 reply; 17+ messages in thread
From: Santosh Shilimkar @ 2012-11-28 6:09 UTC (permalink / raw)
To: linux-arm-kernel
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>
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 3/3] ARM: AM335x: Fix warning in timer.c
2012-11-28 2:15 ` [PATCH 3/3] ARM: AM335x: Fix " Jon Hunter
@ 2012-11-28 6:28 ` Santosh Shilimkar
2012-11-28 6:46 ` Igor Grinberg
2012-11-28 10:21 ` Vaibhav Hiremath
1 sibling, 1 reply; 17+ messages in thread
From: Santosh Shilimkar @ 2012-11-28 6:28 UTC (permalink / raw)
To: linux-arm-kernel
On Wednesday 28 November 2012 07:45 AM, Jon Hunter wrote:
> When compiling the kernel with configuration options ...
>
> # CONFIG_ARCH_OMAP2 is not set
> # CONFIG_ARCH_OMAP3 is not set
> # CONFIG_ARCH_OMAP4 is not set
> # CONFIG_SOC_OMAP5 is not set
> CONFIG_SOC_AM33XX=y
>
> ... the following build warning is seen.
>
> CC arch/arm/mach-omap2/timer.o
> arch/arm/mach-omap2/timer.c:395:19: warning: ?omap2_sync32k_clocksource_init?
> defined but not used [-Wunused-function]
>
> This issue was introduced by commit 6f80b3b (ARM: OMAP2+: timer: remove
> CONFIG_OMAP_32K_TIMER) where the omap2_sync32k_clocksource_init() is no
> longer referenced by the timer initialisation function for the AM335x
> device as it has no 32k-sync timer.
>
> Fix this by only including the omap2_sync32k_clocksource_init() function
> if either OMAP2, OMAP3, OMAP4 or OMAP5 devices are enabled.
>
> Cc: Igor Grinberg <grinberg@compulab.co.il>
>
> Signed-off-by: Jon Hunter <jon-hunter@ti.com>
> ---
> arch/arm/mach-omap2/timer.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
> index eb96712..085c7e7 100644
> --- a/arch/arm/mach-omap2/timer.c
> +++ b/arch/arm/mach-omap2/timer.c
> @@ -386,6 +386,8 @@ static u32 notrace dmtimer_read_sched_clock(void)
> return 0;
> }
>
> +#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) || \
> + defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5)
#ifndef CONFIG_SOC_AM33XX ?
#ifdef things are really ugly and needs constant patching and
hence something like CONFIG_HAS_32K kind of feature flags are
better. But that will undo certain part of f80b3b
(ARM: OMAP2+: timer: remove CONFIG_OMAP_32K_TIMER).
Regards
santosh
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 2/3] ARM: OMAP4: Fix build error and warning in timer.c
2012-11-28 2:15 ` [PATCH 2/3] ARM: OMAP4: Fix build error and " Jon Hunter
2012-11-28 5:47 ` Santosh Shilimkar
@ 2012-11-28 6:40 ` Igor Grinberg
1 sibling, 0 replies; 17+ messages in thread
From: Igor Grinberg @ 2012-11-28 6:40 UTC (permalink / raw)
To: linux-arm-kernel
On 11/28/12 04:15, Jon Hunter wrote:
> When compiling the kernel with configuration option CONFIG_ARCH_OMAP4
> enabled and CONFIG_LOCAL_TIMERS disabled, the following build error and
> warning is seen.
>
> CC arch/arm/mach-omap2/timer.o
> arch/arm/mach-omap2/timer.c: In function ?omap4_local_timer_init?:
> arch/arm/mach-omap2/timer.c:630:2: error: implicit declaration of
> function ?omap4_sync32_timer_init?
> [-Werror=implicit-function-declaration]
> arch/arm/mach-omap2/timer.c: At top level:
> arch/arm/mach-omap2/timer.c:607:1: warning: ?omap4_sync32k_timer_init?
> defined but not used [-Wunused-function]
> cc1: some warnings being treated as errors
> make[1]: *** [arch/arm/mach-omap2/timer.o] Error 1
>
> This issue was introduced by commit 6f80b3b (ARM: OMAP2+: timer: remove
> CONFIG_OMAP_32K_TIMER) where the "k" is missing from the "sync32k" in
> the function name "omap4_sync32_timer_init". Therefore, correct this
> typo to resolve the above error and warning.
Yeah ;-( sorry for this...
>
> Cc: Igor Grinberg <grinberg@compulab.co.il>
>
> Reported-by: Tony Lindgren <tony@atomide.com>
> Signed-off-by: Jon Hunter <jon-hunter@ti.com>
Acked-by: Igor Grinberg <grinberg@compulab.co.il>
> ---
> arch/arm/mach-omap2/timer.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
> index a9f99e3..eb96712 100644
> --- a/arch/arm/mach-omap2/timer.c
> +++ b/arch/arm/mach-omap2/timer.c
> @@ -627,7 +627,7 @@ static void __init omap4_local_timer_init(void)
> #else /* CONFIG_LOCAL_TIMERS */
> static inline void omap4_local_timer_init(void)
> {
> - omap4_sync32_timer_init();
> + omap4_sync32k_timer_init();
> }
> #endif /* CONFIG_LOCAL_TIMERS */
> OMAP_SYS_TIMER(4, local);
--
Regards,
Igor.
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 3/3] ARM: AM335x: Fix warning in timer.c
2012-11-28 6:28 ` Santosh Shilimkar
@ 2012-11-28 6:46 ` Igor Grinberg
2012-11-28 7:20 ` Santosh Shilimkar
0 siblings, 1 reply; 17+ messages in thread
From: Igor Grinberg @ 2012-11-28 6:46 UTC (permalink / raw)
To: linux-arm-kernel
On 11/28/12 08:28, Santosh Shilimkar wrote:
> On Wednesday 28 November 2012 07:45 AM, Jon Hunter wrote:
>> When compiling the kernel with configuration options ...
>>
>> # CONFIG_ARCH_OMAP2 is not set
>> # CONFIG_ARCH_OMAP3 is not set
>> # CONFIG_ARCH_OMAP4 is not set
>> # CONFIG_SOC_OMAP5 is not set
>> CONFIG_SOC_AM33XX=y
>>
>> ... the following build warning is seen.
>>
>> CC arch/arm/mach-omap2/timer.o
>> arch/arm/mach-omap2/timer.c:395:19: warning: ?omap2_sync32k_clocksource_init?
>> defined but not used [-Wunused-function]
>>
>> This issue was introduced by commit 6f80b3b (ARM: OMAP2+: timer: remove
>> CONFIG_OMAP_32K_TIMER) where the omap2_sync32k_clocksource_init() is no
>> longer referenced by the timer initialisation function for the AM335x
>> device as it has no 32k-sync timer.
>>
>> Fix this by only including the omap2_sync32k_clocksource_init() function
>> if either OMAP2, OMAP3, OMAP4 or OMAP5 devices are enabled.
>>
>> Cc: Igor Grinberg <grinberg@compulab.co.il>
>>
>> Signed-off-by: Jon Hunter <jon-hunter@ti.com>
>> ---
>> arch/arm/mach-omap2/timer.c | 3 +++
>> 1 file changed, 3 insertions(+)
>>
>> diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
>> index eb96712..085c7e7 100644
>> --- a/arch/arm/mach-omap2/timer.c
>> +++ b/arch/arm/mach-omap2/timer.c
>> @@ -386,6 +386,8 @@ static u32 notrace dmtimer_read_sched_clock(void)
>> return 0;
>> }
>>
>> +#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) || \
>> + defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5)
> #ifndef CONFIG_SOC_AM33XX ?
>
> #ifdef things are really ugly and needs constant patching and
> hence something like CONFIG_HAS_32K kind of feature flags are
> better. But that will undo certain part of f80b3b
> (ARM: OMAP2+: timer: remove CONFIG_OMAP_32K_TIMER).
Agreed on ugliness of ifdefs.
What about adding __maybe_unused to the function signature?
That will cover any future SoC also w/o the need to extend the ifdefs.
--
Regards,
Igor.
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 3/3] ARM: AM335x: Fix warning in timer.c
2012-11-28 6:46 ` Igor Grinberg
@ 2012-11-28 7:20 ` Santosh Shilimkar
2012-11-28 16:06 ` Jon Hunter
0 siblings, 1 reply; 17+ messages in thread
From: Santosh Shilimkar @ 2012-11-28 7:20 UTC (permalink / raw)
To: linux-arm-kernel
On Wednesday 28 November 2012 12:16 PM, Igor Grinberg wrote:
> On 11/28/12 08:28, Santosh Shilimkar wrote:
>> On Wednesday 28 November 2012 07:45 AM, Jon Hunter wrote:
>>> When compiling the kernel with configuration options ...
>>>
>>> # CONFIG_ARCH_OMAP2 is not set
>>> # CONFIG_ARCH_OMAP3 is not set
>>> # CONFIG_ARCH_OMAP4 is not set
>>> # CONFIG_SOC_OMAP5 is not set
>>> CONFIG_SOC_AM33XX=y
>>>
>>> ... the following build warning is seen.
>>>
>>> CC arch/arm/mach-omap2/timer.o
>>> arch/arm/mach-omap2/timer.c:395:19: warning: ?omap2_sync32k_clocksource_init?
>>> defined but not used [-Wunused-function]
>>>
>>> This issue was introduced by commit 6f80b3b (ARM: OMAP2+: timer: remove
>>> CONFIG_OMAP_32K_TIMER) where the omap2_sync32k_clocksource_init() is no
>>> longer referenced by the timer initialisation function for the AM335x
>>> device as it has no 32k-sync timer.
>>>
>>> Fix this by only including the omap2_sync32k_clocksource_init() function
>>> if either OMAP2, OMAP3, OMAP4 or OMAP5 devices are enabled.
>>>
>>> Cc: Igor Grinberg <grinberg@compulab.co.il>
>>>
>>> Signed-off-by: Jon Hunter <jon-hunter@ti.com>
>>> ---
>>> arch/arm/mach-omap2/timer.c | 3 +++
>>> 1 file changed, 3 insertions(+)
>>>
>>> diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
>>> index eb96712..085c7e7 100644
>>> --- a/arch/arm/mach-omap2/timer.c
>>> +++ b/arch/arm/mach-omap2/timer.c
>>> @@ -386,6 +386,8 @@ static u32 notrace dmtimer_read_sched_clock(void)
>>> return 0;
>>> }
>>>
>>> +#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) || \
>>> + defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5)
>> #ifndef CONFIG_SOC_AM33XX ?
>>
>> #ifdef things are really ugly and needs constant patching and
>> hence something like CONFIG_HAS_32K kind of feature flags are
>> better. But that will undo certain part of f80b3b
>> (ARM: OMAP2+: timer: remove CONFIG_OMAP_32K_TIMER).
>
> Agreed on ugliness of ifdefs.
> What about adding __maybe_unused to the function signature?
> That will cover any future SoC also w/o the need to extend the ifdefs.
>
Sounds good to me.
Regards
Santosh
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 3/3] ARM: AM335x: Fix warning in timer.c
2012-11-28 2:15 ` [PATCH 3/3] ARM: AM335x: Fix " Jon Hunter
2012-11-28 6:28 ` Santosh Shilimkar
@ 2012-11-28 10:21 ` Vaibhav Hiremath
1 sibling, 0 replies; 17+ messages in thread
From: Vaibhav Hiremath @ 2012-11-28 10:21 UTC (permalink / raw)
To: linux-arm-kernel
On 11/28/2012 7:45 AM, Jon Hunter wrote:
> When compiling the kernel with configuration options ...
>
> # CONFIG_ARCH_OMAP2 is not set
> # CONFIG_ARCH_OMAP3 is not set
> # CONFIG_ARCH_OMAP4 is not set
> # CONFIG_SOC_OMAP5 is not set
> CONFIG_SOC_AM33XX=y
>
> ... the following build warning is seen.
>
> CC arch/arm/mach-omap2/timer.o
> arch/arm/mach-omap2/timer.c:395:19: warning: ?omap2_sync32k_clocksource_init?
> defined but not used [-Wunused-function]
>
> This issue was introduced by commit 6f80b3b (ARM: OMAP2+: timer: remove
> CONFIG_OMAP_32K_TIMER) where the omap2_sync32k_clocksource_init() is no
> longer referenced by the timer initialisation function for the AM335x
> device as it has no 32k-sync timer.
>
> Fix this by only including the omap2_sync32k_clocksource_init() function
> if either OMAP2, OMAP3, OMAP4 or OMAP5 devices are enabled.
>
> Cc: Igor Grinberg <grinberg@compulab.co.il>
>
> Signed-off-by: Jon Hunter <jon-hunter@ti.com>
> ---
> arch/arm/mach-omap2/timer.c | 3 +++
> 1 file changed, 3 insertions(+)
>
Jon,
I applied all these patches and it fixes build warning and also I have
tested it on Bone platform without any issues.
I also ran parse on this and saw further warning,
CHECK arch/arm/mach-omap2/timer.c
arch/arm/mach-omap2/timer.c:193:13: warning: symbol 'omap_dmtimer_init'
was not declared. Should it be static?
arch/arm/mach-omap2/timer.c:213:12: warning: symbol
'omap_dm_timer_get_errata' was not declared. Should it be static?
Below patch fixes that too, feel free to merge it into your's
diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index 085c7e7..1d1cfec 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -190,7 +190,7 @@ static struct device_node * __init
omap_get_timer_dt(struct of_device_id *match,
* kernel registering these devices remove them dynamically from the device
* tree on boot.
*/
-void __init omap_dmtimer_init(void)
+static void __init omap_dmtimer_init(void)
{
struct device_node *np;
@@ -210,7 +210,7 @@ void __init omap_dmtimer_init(void)
*
* Get the timer errata flags that are specific to the OMAP device
being used.
*/
-u32 __init omap_dm_timer_get_errata(void)
+static u32 __init omap_dm_timer_get_errata(void)
{
if (cpu_is_omap24xx())
return 0;
Thanks,
Vaibhav
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 1/3] ARM: OMAP2+: Fix realtime_counter_init warning in timer.c
2012-11-28 6:09 ` Santosh Shilimkar
@ 2012-11-28 15:47 ` Jon Hunter
2012-11-28 15:55 ` Santosh Shilimkar
2012-11-28 16:04 ` Santosh Shilimkar
0 siblings, 2 replies; 17+ messages in thread
From: Jon Hunter @ 2012-11-28 15:47 UTC (permalink / raw)
To: linux-arm-kernel
On 11/28/2012 12:09 AM, Santosh Shilimkar wrote:
> 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, \
Hi Santosh,
Thanks for the feedback. Unfortunately, the above is not enough. If I
disable SOC_OMAP5 and leave SOC_HAS_REALTIME_COUNTER enabled, then I
still see the warning message. So I could see that people could still
hit this with randconfig.
Understand the desire to make this a selectable configuration, but given
to date only OMAP5 uses it, it was simpler and cleaner just to remove
the option. However, we could keep the option and just do something like ...
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 813c267..500f2f6 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -26,6 +26,8 @@ config SOC_HAS_OMAP2_SDRC
config SOC_HAS_REALTIME_COUNTER
bool "Real time free running counter"
+ depends on SOC_OMAP5
+ default y
config ARCH_OMAP2
bool "TI OMAP2"
@@ -79,7 +81,6 @@ config SOC_OMAP5
select ARM_GIC
select CPU_V7
select HAVE_SMP
- select SOC_HAS_REALTIME_COUNTER
select COMMON_CLK
I have tested this and this resolves the warning.
Cheers
Jon
^ permalink raw reply related [flat|nested] 17+ messages in thread
* [PATCH 1/3] ARM: OMAP2+: Fix realtime_counter_init warning in timer.c
2012-11-28 15:47 ` Jon Hunter
@ 2012-11-28 15:55 ` Santosh Shilimkar
2012-11-28 16:01 ` Jon Hunter
2012-11-28 16:04 ` Santosh Shilimkar
1 sibling, 1 reply; 17+ messages in thread
From: Santosh Shilimkar @ 2012-11-28 15:55 UTC (permalink / raw)
To: linux-arm-kernel
On Wednesday 28 November 2012 09:17 PM, Jon Hunter wrote:
>
> On 11/28/2012 12:09 AM, Santosh Shilimkar wrote:
>> 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, \
>
> Hi Santosh,
>
> Thanks for the feedback. Unfortunately, the above is not enough. If I
> disable SOC_OMAP5 and leave SOC_HAS_REALTIME_COUNTER enabled, then I
> still see the warning message. So I could see that people could still
> hit this with randconfig.
>
I did mention that but since OMAP5 selects the feature, I was thinking
it is fine.
> Understand the desire to make this a selectable configuration, but given
> to date only OMAP5 uses it, it was simpler and cleaner just to remove
> the option. However, we could keep the option and just do something like ...
>
> diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
> index 813c267..500f2f6 100644
> --- a/arch/arm/mach-omap2/Kconfig
> +++ b/arch/arm/mach-omap2/Kconfig
> @@ -26,6 +26,8 @@ config SOC_HAS_OMAP2_SDRC
>
> config SOC_HAS_REALTIME_COUNTER
> bool "Real time free running counter"
> + depends on SOC_OMAP5
> + default y
>
> config ARCH_OMAP2
> bool "TI OMAP2"
> @@ -79,7 +81,6 @@ config SOC_OMAP5
> select ARM_GIC
> select CPU_V7
> select HAVE_SMP
> - select SOC_HAS_REALTIME_COUNTER
> select COMMON_CLK
>
> I have tested this and this resolves the warning.
>
Go ahead and fold above change on top of my patch which
drops the stub.
Regards
Santosh
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 1/3] ARM: OMAP2+: Fix realtime_counter_init warning in timer.c
2012-11-28 15:55 ` Santosh Shilimkar
@ 2012-11-28 16:01 ` Jon Hunter
2012-11-28 16:06 ` Santosh Shilimkar
0 siblings, 1 reply; 17+ messages in thread
From: Jon Hunter @ 2012-11-28 16:01 UTC (permalink / raw)
To: linux-arm-kernel
On 11/28/2012 09:55 AM, Santosh Shilimkar wrote:
> On Wednesday 28 November 2012 09:17 PM, Jon Hunter wrote:
>>
>> On 11/28/2012 12:09 AM, Santosh Shilimkar wrote:
>>> 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, \
>>
>> Hi Santosh,
>>
>> Thanks for the feedback. Unfortunately, the above is not enough. If I
>> disable SOC_OMAP5 and leave SOC_HAS_REALTIME_COUNTER enabled, then I
>> still see the warning message. So I could see that people could still
>> hit this with randconfig.
>>
> I did mention that but since OMAP5 selects the feature, I was thinking
> it is fine.
>
>> Understand the desire to make this a selectable configuration, but given
>> to date only OMAP5 uses it, it was simpler and cleaner just to remove
>> the option. However, we could keep the option and just do something
>> like ...
>>
>> diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
>> index 813c267..500f2f6 100644
>> --- a/arch/arm/mach-omap2/Kconfig
>> +++ b/arch/arm/mach-omap2/Kconfig
>> @@ -26,6 +26,8 @@ config SOC_HAS_OMAP2_SDRC
>>
>> config SOC_HAS_REALTIME_COUNTER
>> bool "Real time free running counter"
>> + depends on SOC_OMAP5
>> + default y
>>
>> config ARCH_OMAP2
>> bool "TI OMAP2"
>> @@ -79,7 +81,6 @@ config SOC_OMAP5
>> select ARM_GIC
>> select CPU_V7
>> select HAVE_SMP
>> - select SOC_HAS_REALTIME_COUNTER
>> select COMMON_CLK
>>
>> I have tested this and this resolves the warning.
>>
> Go ahead and fold above change on top of my patch which
> drops the stub.
Well if we drop the stub then we cannot make it selectable for OMAP5. So
in other words folding the above change on top of your patch will still
not work ;-)
The above patch will only allow you to use the REALTIME COUNTER on
OMAP5, but it makes it selectable and so the stub is needed now. If
future devices wish to use the REALTIME COUNTER then they can be added
to the "depends on" statement.
The above patch should be all we need.
Cheers
Jon
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 1/3] ARM: OMAP2+: Fix realtime_counter_init warning in timer.c
2012-11-28 15:47 ` Jon Hunter
2012-11-28 15:55 ` Santosh Shilimkar
@ 2012-11-28 16:04 ` Santosh Shilimkar
1 sibling, 0 replies; 17+ messages in thread
From: Santosh Shilimkar @ 2012-11-28 16:04 UTC (permalink / raw)
To: linux-arm-kernel
On Wednesday 28 November 2012 09:17 PM, Jon Hunter wrote:
>
> On 11/28/2012 12:09 AM, Santosh Shilimkar wrote:
>> 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, \
>
> Hi Santosh,
>
> Thanks for the feedback. Unfortunately, the above is not enough. If I
> disable SOC_OMAP5 and leave SOC_HAS_REALTIME_COUNTER enabled, then I
> still see the warning message. So I could see that people could still
> hit this with randconfig.
>
Yes. For the same reason initially, the stub was added.
> Understand the desire to make this a selectable configuration, but given
> to date only OMAP5 uses it, it was simpler and cleaner just to remove
> the option. However, we could keep the option and just do something like ...
>
> diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
> index 813c267..500f2f6 100644
> --- a/arch/arm/mach-omap2/Kconfig
> +++ b/arch/arm/mach-omap2/Kconfig
> @@ -26,6 +26,8 @@ config SOC_HAS_OMAP2_SDRC
>
> config SOC_HAS_REALTIME_COUNTER
> bool "Real time free running counter"
> + depends on SOC_OMAP5
> + default y
>
> config ARCH_OMAP2
> bool "TI OMAP2"
> @@ -79,7 +81,6 @@ config SOC_OMAP5
> select ARM_GIC
> select CPU_V7
> select HAVE_SMP
> - select SOC_HAS_REALTIME_COUNTER
> select COMMON_CLK
>
> I have tested this and this resolves the warning.
>
Good. Am ok with above additional update.
May be you can add this change on top of my patch
which drops the stub.
Regards
Santosh
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 3/3] ARM: AM335x: Fix warning in timer.c
2012-11-28 7:20 ` Santosh Shilimkar
@ 2012-11-28 16:06 ` Jon Hunter
0 siblings, 0 replies; 17+ messages in thread
From: Jon Hunter @ 2012-11-28 16:06 UTC (permalink / raw)
To: linux-arm-kernel
On 11/28/2012 01:20 AM, Santosh Shilimkar wrote:
> On Wednesday 28 November 2012 12:16 PM, Igor Grinberg wrote:
>> On 11/28/12 08:28, Santosh Shilimkar wrote:
>>> On Wednesday 28 November 2012 07:45 AM, Jon Hunter wrote:
>>>> When compiling the kernel with configuration options ...
>>>>
>>>> # CONFIG_ARCH_OMAP2 is not set
>>>> # CONFIG_ARCH_OMAP3 is not set
>>>> # CONFIG_ARCH_OMAP4 is not set
>>>> # CONFIG_SOC_OMAP5 is not set
>>>> CONFIG_SOC_AM33XX=y
>>>>
>>>> ... the following build warning is seen.
>>>>
>>>> CC arch/arm/mach-omap2/timer.o
>>>> arch/arm/mach-omap2/timer.c:395:19: warning:
>>>> ?omap2_sync32k_clocksource_init?
>>>> defined but not used [-Wunused-function]
>>>>
>>>> This issue was introduced by commit 6f80b3b (ARM: OMAP2+: timer: remove
>>>> CONFIG_OMAP_32K_TIMER) where the omap2_sync32k_clocksource_init() is no
>>>> longer referenced by the timer initialisation function for the AM335x
>>>> device as it has no 32k-sync timer.
>>>>
>>>> Fix this by only including the omap2_sync32k_clocksource_init()
>>>> function
>>>> if either OMAP2, OMAP3, OMAP4 or OMAP5 devices are enabled.
>>>>
>>>> Cc: Igor Grinberg <grinberg@compulab.co.il>
>>>>
>>>> Signed-off-by: Jon Hunter <jon-hunter@ti.com>
>>>> ---
>>>> arch/arm/mach-omap2/timer.c | 3 +++
>>>> 1 file changed, 3 insertions(+)
>>>>
>>>> diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
>>>> index eb96712..085c7e7 100644
>>>> --- a/arch/arm/mach-omap2/timer.c
>>>> +++ b/arch/arm/mach-omap2/timer.c
>>>> @@ -386,6 +386,8 @@ static u32 notrace dmtimer_read_sched_clock(void)
>>>> return 0;
>>>> }
>>>>
>>>> +#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3) || \
>>>> + defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5)
>>> #ifndef CONFIG_SOC_AM33XX ?
>>>
>>> #ifdef things are really ugly and needs constant patching and
>>> hence something like CONFIG_HAS_32K kind of feature flags are
>>> better. But that will undo certain part of f80b3b
>>> (ARM: OMAP2+: timer: remove CONFIG_OMAP_32K_TIMER).
>>
>> Agreed on ugliness of ifdefs.
>> What about adding __maybe_unused to the function signature?
>> That will cover any future SoC also w/o the need to extend the ifdefs.
>>
> Sounds good to me.
Yes agree on the ugliness of this. However, my thought was these would
only remain until we migrate over to device-tree and then the detection
of the a 32k source can be determine via DT.
However, I can update to use __maybe_unused for now. We just need to
remember to remove this in the future if it becomes unnecessary :-)
Cheers
Jon
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH 1/3] ARM: OMAP2+: Fix realtime_counter_init warning in timer.c
2012-11-28 16:01 ` Jon Hunter
@ 2012-11-28 16:06 ` Santosh Shilimkar
0 siblings, 0 replies; 17+ messages in thread
From: Santosh Shilimkar @ 2012-11-28 16:06 UTC (permalink / raw)
To: linux-arm-kernel
On Wednesday 28 November 2012 09:31 PM, Jon Hunter wrote:
>
> On 11/28/2012 09:55 AM, Santosh Shilimkar wrote:
>> On Wednesday 28 November 2012 09:17 PM, Jon Hunter wrote:
>>>
>>> On 11/28/2012 12:09 AM, Santosh Shilimkar wrote:
>>>> 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, \
>>>
>>> Hi Santosh,
>>>
>>> Thanks for the feedback. Unfortunately, the above is not enough. If I
>>> disable SOC_OMAP5 and leave SOC_HAS_REALTIME_COUNTER enabled, then I
>>> still see the warning message. So I could see that people could still
>>> hit this with randconfig.
>>>
>> I did mention that but since OMAP5 selects the feature, I was thinking
>> it is fine.
>>
>>> Understand the desire to make this a selectable configuration, but given
>>> to date only OMAP5 uses it, it was simpler and cleaner just to remove
>>> the option. However, we could keep the option and just do something
>>> like ...
>>>
>>> diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
>>> index 813c267..500f2f6 100644
>>> --- a/arch/arm/mach-omap2/Kconfig
>>> +++ b/arch/arm/mach-omap2/Kconfig
>>> @@ -26,6 +26,8 @@ config SOC_HAS_OMAP2_SDRC
>>>
>>> config SOC_HAS_REALTIME_COUNTER
>>> bool "Real time free running counter"
>>> + depends on SOC_OMAP5
>>> + default y
>>>
>>> config ARCH_OMAP2
>>> bool "TI OMAP2"
>>> @@ -79,7 +81,6 @@ config SOC_OMAP5
>>> select ARM_GIC
>>> select CPU_V7
>>> select HAVE_SMP
>>> - select SOC_HAS_REALTIME_COUNTER
>>> select COMMON_CLK
>>>
>>> I have tested this and this resolves the warning.
>>>
>> Go ahead and fold above change on top of my patch which
>> drops the stub.
>
> Well if we drop the stub then we cannot make it selectable for OMAP5. So
> in other words folding the above change on top of your patch will still
> not work ;-)
>
Oh yes.. Just ignore another follow up email which i sent thinking I
lost the connection in between.
> The above patch will only allow you to use the REALTIME COUNTER on
> OMAP5, but it makes it selectable and so the stub is needed now. If
> future devices wish to use the REALTIME COUNTER then they can be added
> to the "depends on" statement.
>
> The above patch should be all we need.
>
I agree. Feel free to add my ack when you cook up the patch
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2012-11-28 16:06 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-28 2:15 [PATCH 0/3] ARM: OMAP2+: Timer build warnings and error fixes 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 6:09 ` Santosh Shilimkar
2012-11-28 15:47 ` Jon Hunter
2012-11-28 15:55 ` Santosh Shilimkar
2012-11-28 16:01 ` Jon Hunter
2012-11-28 16:06 ` 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 5:47 ` Santosh Shilimkar
2012-11-28 6:40 ` Igor Grinberg
2012-11-28 2:15 ` [PATCH 3/3] ARM: AM335x: Fix " Jon Hunter
2012-11-28 6:28 ` Santosh Shilimkar
2012-11-28 6:46 ` Igor Grinberg
2012-11-28 7:20 ` Santosh Shilimkar
2012-11-28 16:06 ` Jon Hunter
2012-11-28 10:21 ` Vaibhav Hiremath
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).