Linux on ARM based TI OMAP SoCs
 help / color / mirror / Atom feed
* [PATCH] ARM: OMAP2+: Fix compiler warning for 32k timer
@ 2012-11-15 19:44 Jon Hunter
  2012-11-15 20:45 ` Felipe Balbi
  0 siblings, 1 reply; 5+ messages in thread
From: Jon Hunter @ 2012-11-15 19:44 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: linux-omap, linux-arm, Kevin Hilman, Jon Hunter

Commit "ARM: OMAP2+: Add device-tree support for 32kHz counter"
added structure omap_counter_match to the OMAP2 timer code. When
CONFIG_OMAP_32K_TIMER is not defined this structure generates the
following as it is not used.

  CC      arch/arm/mach-omap2/timer.o
  arch/arm/mach-omap2/timer.c:163:28: warning: 'omap_counter_match'
  defined but not used [-Wunused-variable]

Move the definition of omap_counter_match to avoid this warning when
CONFIG_OMAP_32K_TIMER is not set.

Thanks to Kevin Hilman for tracking down and reporting this problem.

Reported-by: Kevin Hilam <khilman@deeprootsystems.com>
Signed-off-by: Jon Hunter <jon-hunter@ti.com>
---

This is based upon Tony Lindgren's OMAP master branch.

 arch/arm/mach-omap2/timer.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-omap2/timer.c b/arch/arm/mach-omap2/timer.c
index 099e406..2b9d485 100644
--- a/arch/arm/mach-omap2/timer.c
+++ b/arch/arm/mach-omap2/timer.c
@@ -160,11 +160,6 @@ static struct of_device_id omap_timer_match[] __initdata = {
 	{ }
 };
 
-static struct of_device_id omap_counter_match[] __initdata = {
-	{ .compatible = "ti,omap-counter32k", },
-	{ }
-};
-
 /**
  * omap_get_timer_dt - get a timer using device-tree
  * @match	- device-tree match structure for matching a device type
@@ -408,6 +403,11 @@ static u32 notrace dmtimer_read_sched_clock(void)
 }
 
 #ifdef CONFIG_OMAP_32K_TIMER
+static struct of_device_id omap_counter_match[] __initdata = {
+	{ .compatible = "ti,omap-counter32k", },
+	{ }
+};
+
 /* Setup free-running counter for clocksource */
 static int __init omap2_sync32k_clocksource_init(void)
 {
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] ARM: OMAP2+: Fix compiler warning for 32k timer
  2012-11-15 19:44 [PATCH] ARM: OMAP2+: Fix compiler warning for 32k timer Jon Hunter
@ 2012-11-15 20:45 ` Felipe Balbi
  2012-11-15 21:35   ` Jon Hunter
  0 siblings, 1 reply; 5+ messages in thread
From: Felipe Balbi @ 2012-11-15 20:45 UTC (permalink / raw)
  To: Jon Hunter; +Cc: Tony Lindgren, Kevin Hilman, linux-omap, linux-arm


[-- Attachment #1.1: Type: text/plain, Size: 236 bytes --]

Hi,

On Thu, Nov 15, 2012 at 01:44:04PM -0600, Jon Hunter wrote:
> +static struct of_device_id omap_counter_match[] __initdata = {

not directly related to $SUBJECT, but shouldn't this be static const
__initconst ?

-- 
balbi

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ARM: OMAP2+: Fix compiler warning for 32k timer
  2012-11-15 20:45 ` Felipe Balbi
@ 2012-11-15 21:35   ` Jon Hunter
  2012-11-16  7:52     ` Felipe Balbi
  0 siblings, 1 reply; 5+ messages in thread
From: Jon Hunter @ 2012-11-15 21:35 UTC (permalink / raw)
  To: balbi; +Cc: Tony Lindgren, linux-omap, linux-arm, Kevin Hilman


On 11/15/2012 02:45 PM, Felipe Balbi wrote:
> Hi,
> 
> On Thu, Nov 15, 2012 at 01:44:04PM -0600, Jon Hunter wrote:
>> +static struct of_device_id omap_counter_match[] __initdata = {
> 
> not directly related to $SUBJECT, but shouldn't this be static const
> __initconst ?

Yes you are right. Looks like there are several other of_device_id
structs in arch/arm/mach-omap2 that could be updated to const too.

Cheers
Jon


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ARM: OMAP2+: Fix compiler warning for 32k timer
  2012-11-15 21:35   ` Jon Hunter
@ 2012-11-16  7:52     ` Felipe Balbi
  2012-11-16 15:03       ` Jon Hunter
  0 siblings, 1 reply; 5+ messages in thread
From: Felipe Balbi @ 2012-11-16  7:52 UTC (permalink / raw)
  To: Jon Hunter; +Cc: balbi, Tony Lindgren, linux-omap, linux-arm, Kevin Hilman

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

Hi,

On Thu, Nov 15, 2012 at 03:35:47PM -0600, Jon Hunter wrote:
> 
> On 11/15/2012 02:45 PM, Felipe Balbi wrote:
> > Hi,
> > 
> > On Thu, Nov 15, 2012 at 01:44:04PM -0600, Jon Hunter wrote:
> >> +static struct of_device_id omap_counter_match[] __initdata = {
> > 
> > not directly related to $SUBJECT, but shouldn't this be static const
> > __initconst ?
> 
> Yes you are right. Looks like there are several other of_device_id
> structs in arch/arm/mach-omap2 that could be updated to const too.

here's a quick sed substitution for you:

$ sed -i 's/static \(struct of_device_id\)\s\(\w\+\[\]\)\s\(__initdata\|\)/static const \1 \2 __initconst/' arch/arm/*omap*/*.c

It worked fine here.

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ARM: OMAP2+: Fix compiler warning for 32k timer
  2012-11-16  7:52     ` Felipe Balbi
@ 2012-11-16 15:03       ` Jon Hunter
  0 siblings, 0 replies; 5+ messages in thread
From: Jon Hunter @ 2012-11-16 15:03 UTC (permalink / raw)
  To: balbi; +Cc: Tony Lindgren, linux-omap, linux-arm, Kevin Hilman


On 11/16/2012 01:52 AM, Felipe Balbi wrote:
> Hi,
> 
> On Thu, Nov 15, 2012 at 03:35:47PM -0600, Jon Hunter wrote:
>>
>> On 11/15/2012 02:45 PM, Felipe Balbi wrote:
>>> Hi,
>>>
>>> On Thu, Nov 15, 2012 at 01:44:04PM -0600, Jon Hunter wrote:
>>>> +static struct of_device_id omap_counter_match[] __initdata = {
>>>
>>> not directly related to $SUBJECT, but shouldn't this be static const
>>> __initconst ?
>>
>> Yes you are right. Looks like there are several other of_device_id
>> structs in arch/arm/mach-omap2 that could be updated to const too.
> 
> here's a quick sed substitution for you:
> 
> $ sed -i 's/static \(struct of_device_id\)\s\(\w\+\[\]\)\s\(__initdata\|\)/static const \1 \2 __initconst/' arch/arm/*omap*/*.c
> 
> It worked fine here.

Thanks. Will fix this up in a subsequent patch.

Cheers
Jon


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-11-16 15:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-15 19:44 [PATCH] ARM: OMAP2+: Fix compiler warning for 32k timer Jon Hunter
2012-11-15 20:45 ` Felipe Balbi
2012-11-15 21:35   ` Jon Hunter
2012-11-16  7:52     ` Felipe Balbi
2012-11-16 15:03       ` Jon Hunter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox