* [PATCH V2 1/4] ARM: OMAP2+: Fix realtime_counter_init warning in timer.c
2012-11-28 22:04 [PATCH V2 0/4] ARM: OMAP2+: Timer build warnings and error fixes Jon Hunter
@ 2012-11-28 22:04 ` Jon Hunter
2012-11-28 22:04 ` [PATCH V2 2/4] ARM: OMAP4: Fix build error and " Jon Hunter
` (2 subsequent siblings)
3 siblings, 0 replies; 8+ messages in thread
From: Jon Hunter @ 2012-11-28 22:04 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.
For non-OMAP5 devices, there is no realtime counter and so
realtime_counter_init() function and stub function are not used for
these devices. Therefore, fix this warning by only allowing the kernel
configuration option CONFIG_SOC_HAS_REALTIME_COUNTER to be enabled for
OMAP5 devices.
Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
Reported-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Jon Hunter <jon-hunter@ti.com>
Acked-by Santosh Shilimkar <santosh.shilimkar@ti.com>
---
arch/arm/mach-omap2/Kconfig | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
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
comment "OMAP Core Type"
--
1.7.10.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH V2 2/4] ARM: OMAP4: Fix build error and warning in timer.c
2012-11-28 22:04 [PATCH V2 0/4] ARM: OMAP2+: Timer build warnings and error fixes Jon Hunter
2012-11-28 22:04 ` [PATCH V2 1/4] ARM: OMAP2+: Fix realtime_counter_init warning in timer.c Jon Hunter
@ 2012-11-28 22:04 ` Jon Hunter
2012-11-28 22:04 ` [PATCH V2 3/4] ARM: AM335x: Fix " Jon Hunter
2012-11-28 22:05 ` [PATCH V2 4/4] ARM: OMAP2+: Fix sparse warnings " Jon Hunter
3 siblings, 0 replies; 8+ messages in thread
From: Jon Hunter @ 2012-11-28 22:04 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>
Acked-by: Santosh Shilimkar <santosh.shilimkar@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 b9cff72..3bbb244 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -630,7 +630,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] 8+ messages in thread
* [PATCH V2 3/4] ARM: AM335x: Fix warning in timer.c
2012-11-28 22:04 [PATCH V2 0/4] ARM: OMAP2+: Timer build warnings and error fixes Jon Hunter
2012-11-28 22:04 ` [PATCH V2 1/4] ARM: OMAP2+: Fix realtime_counter_init warning in timer.c Jon Hunter
2012-11-28 22:04 ` [PATCH V2 2/4] ARM: OMAP4: Fix build error and " Jon Hunter
@ 2012-11-28 22:04 ` Jon Hunter
2012-11-29 5:15 ` Santosh Shilimkar
2012-11-29 7:10 ` Igor Grinberg
2012-11-28 22:05 ` [PATCH V2 4/4] ARM: OMAP2+: Fix sparse warnings " Jon Hunter
3 siblings, 2 replies; 8+ messages in thread
From: Jon Hunter @ 2012-11-28 22:04 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 adding the "__maybe_unused" compiler directive to the
omap2_sync32k_clocksource_init() function to indicate that this function
may be used for certain configurations.
Cc: Igor Grinberg <grinberg@compulab.co.il>
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 3bbb244..79df809 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -392,7 +392,7 @@ static struct of_device_id omap_counter_match[] __initdata = {
};
/* Setup free-running counter for clocksource */
-static int __init omap2_sync32k_clocksource_init(void)
+static int __init __maybe_unused omap2_sync32k_clocksource_init(void)
{
int ret;
struct device_node *np = NULL;
--
1.7.10.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH V2 3/4] ARM: AM335x: Fix warning in timer.c
2012-11-28 22:04 ` [PATCH V2 3/4] ARM: AM335x: Fix " Jon Hunter
@ 2012-11-29 5:15 ` Santosh Shilimkar
2012-11-29 7:10 ` Igor Grinberg
1 sibling, 0 replies; 8+ messages in thread
From: Santosh Shilimkar @ 2012-11-29 5:15 UTC (permalink / raw)
To: linux-arm-kernel
On Thursday 29 November 2012 03:34 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 adding the "__maybe_unused" compiler directive to the
> omap2_sync32k_clocksource_init() function to indicate that this function
> may be used for certain configurations.
>
> Cc: Igor Grinberg <grinberg@compulab.co.il>
>
> Signed-off-by: Jon Hunter <jon-hunter@ti.com>
> ---
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH V2 3/4] ARM: AM335x: Fix warning in timer.c
2012-11-28 22:04 ` [PATCH V2 3/4] ARM: AM335x: Fix " Jon Hunter
2012-11-29 5:15 ` Santosh Shilimkar
@ 2012-11-29 7:10 ` Igor Grinberg
1 sibling, 0 replies; 8+ messages in thread
From: Igor Grinberg @ 2012-11-29 7:10 UTC (permalink / raw)
To: linux-arm-kernel
On 11/29/12 00:04, 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 adding the "__maybe_unused" compiler directive to the
> omap2_sync32k_clocksource_init() function to indicate that this function
> may be used for certain configurations.
>
> Cc: Igor Grinberg <grinberg@compulab.co.il>
>
> Signed-off-by: Jon Hunter <jon-hunter@ti.com>
Acked-by: Igor Grinberg <grinberg@compulab.co.il>
--
Regards,
Igor.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH V2 4/4] ARM: OMAP2+: Fix sparse warnings in timer.c
2012-11-28 22:04 [PATCH V2 0/4] ARM: OMAP2+: Timer build warnings and error fixes Jon Hunter
` (2 preceding siblings ...)
2012-11-28 22:04 ` [PATCH V2 3/4] ARM: AM335x: Fix " Jon Hunter
@ 2012-11-28 22:05 ` Jon Hunter
2012-11-29 5:16 ` Santosh Shilimkar
3 siblings, 1 reply; 8+ messages in thread
From: Jon Hunter @ 2012-11-28 22:05 UTC (permalink / raw)
To: linux-arm-kernel
From: Vaibhav Hiremath <hvaibhav@ti.com>
Sparse generates the following warnings when compiling mach-omap2/timer.c.
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?
Add static to function declaration to fix warnings.
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: Jon Hunter <jon-hunter@ti.com>
---
arch/arm/mach-omap2/timer.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index 79df809..c6d173f 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;
--
1.7.10.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH V2 4/4] ARM: OMAP2+: Fix sparse warnings in timer.c
2012-11-28 22:05 ` [PATCH V2 4/4] ARM: OMAP2+: Fix sparse warnings " Jon Hunter
@ 2012-11-29 5:16 ` Santosh Shilimkar
0 siblings, 0 replies; 8+ messages in thread
From: Santosh Shilimkar @ 2012-11-29 5:16 UTC (permalink / raw)
To: linux-arm-kernel
On Thursday 29 November 2012 03:35 AM, Jon Hunter wrote:
> From: Vaibhav Hiremath <hvaibhav@ti.com>
>
> Sparse generates the following warnings when compiling mach-omap2/timer.c.
>
> 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?
>
> Add static to function declaration to fix warnings.
>
> Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
> Signed-off-by: Jon Hunter <jon-hunter@ti.com>
> ---
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
^ permalink raw reply [flat|nested] 8+ messages in thread