linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] clocksource: arc_timer: eliminate redefined macro error
@ 2021-09-23  3:18 Randy Dunlap
  2021-09-23  9:42 ` Shahab Vahedi
  0 siblings, 1 reply; 3+ messages in thread
From: Randy Dunlap @ 2021-09-23  3:18 UTC (permalink / raw)
  To: linux-kernel
  Cc: Randy Dunlap, Vineet Gupta, linux-snps-arc, Daniel Lezcano,
	Thomas Gleixner

In drivers/clocksource/, 3 drivers use "TIMER_CTRL_IE" with 3 different
values.  Two of them (mps2-timer.c and timer-sp804.c/timer-sp.h) are
localized and left unmodifed.

One of them uses a shared header file (<soc/arc/timers.h>), which is
what is causing the "redefined" warnings, so change the macro name in
that driver only.

In file included from ../drivers/clocksource/timer-sp804.c:24:
../drivers/clocksource/timer-sp.h:25: error: "TIMER_CTRL_IE" redefined [-Werror]
   25 | #define TIMER_CTRL_IE           (1 << 5)        /*   VR */
../include/soc/arc/timers.h:20: note: this is the location of the previous definition
   20 | #define TIMER_CTRL_IE           (1 << 0) /* Interrupt when Count reaches limit */

Fixes: b26c2e3823ba ("ARC: breakout timer include code into separate header")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Vineet Gupta <vgupta@kernel.org>
Cc: linux-snps-arc@lists.infradead.org
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
---
 drivers/clocksource/arc_timer.c |    2 +-
 include/soc/arc/timers.h        |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

--- linux-next-20210917.orig/include/soc/arc/timers.h
+++ linux-next-20210917/include/soc/arc/timers.h
@@ -17,7 +17,7 @@
 #define ARC_REG_TIMER1_CNT	0x100	/* timer 1 count */
 
 /* CTRL reg bits */
-#define TIMER_CTRL_IE	        (1 << 0) /* Interrupt when Count reaches limit */
+#define TIMER_CTRL_IEN	        (1 << 0) /* Interrupt when Count reaches limit */
 #define TIMER_CTRL_NH	        (1 << 1) /* Count only when CPU NOT halted */
 
 #define ARC_TIMERN_MAX		0xFFFFFFFF
--- linux-next-20210917.orig/drivers/clocksource/arc_timer.c
+++ linux-next-20210917/drivers/clocksource/arc_timer.c
@@ -245,7 +245,7 @@ static void arc_timer_event_setup(unsign
 	write_aux_reg(ARC_REG_TIMER0_LIMIT, cycles);
 	write_aux_reg(ARC_REG_TIMER0_CNT, 0);	/* start from 0 */
 
-	write_aux_reg(ARC_REG_TIMER0_CTRL, TIMER_CTRL_IE | TIMER_CTRL_NH);
+	write_aux_reg(ARC_REG_TIMER0_CTRL, TIMER_CTRL_IEN | TIMER_CTRL_NH);
 }
 
 

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

* Re: [PATCH] clocksource: arc_timer: eliminate redefined macro error
  2021-09-23  3:18 [PATCH] clocksource: arc_timer: eliminate redefined macro error Randy Dunlap
@ 2021-09-23  9:42 ` Shahab Vahedi
  2021-09-23 15:29   ` Randy Dunlap
  0 siblings, 1 reply; 3+ messages in thread
From: Shahab Vahedi @ 2021-09-23  9:42 UTC (permalink / raw)
  To: Randy Dunlap, linux-kernel
  Cc: Vineet Gupta, linux-snps-arc, Daniel Lezcano, Thomas Gleixner

Hi Randy,

I have one minor comment.

On 9/23/21 5:18 AM, Randy Dunlap wrote:
> 
> --- linux-next-20210917.orig/include/soc/arc/timers.h
> +++ linux-next-20210917/include/soc/arc/timers.h
> @@ -17,7 +17,7 @@
>  #define ARC_REG_TIMER1_CNT	0x100	/* timer 1 count */
>  
>  /* CTRL reg bits */
> -#define TIMER_CTRL_IE	        (1 << 0) /* Interrupt when Count reaches limit */
> +#define TIMER_CTRL_IEN	        (1 << 0) /* Interrupt when Count reaches limit */

Could you change the name to "ARC_TIMER_CTRL_IE" instead? and while at it, please rename
"TIMER_CTRL_NH" to "ARC_TIMER_CTRL_NH" for obvious consistency reasons and saving us
from future clashes.  Thank you!

-- 
Shahab

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

* Re: [PATCH] clocksource: arc_timer: eliminate redefined macro error
  2021-09-23  9:42 ` Shahab Vahedi
@ 2021-09-23 15:29   ` Randy Dunlap
  0 siblings, 0 replies; 3+ messages in thread
From: Randy Dunlap @ 2021-09-23 15:29 UTC (permalink / raw)
  To: Shahab Vahedi, linux-kernel
  Cc: Vineet Gupta, linux-snps-arc, Daniel Lezcano, Thomas Gleixner

On 9/23/21 2:42 AM, Shahab Vahedi wrote:
> Hi Randy,
> 
> I have one minor comment.
> 
> On 9/23/21 5:18 AM, Randy Dunlap wrote:
>>
>> --- linux-next-20210917.orig/include/soc/arc/timers.h
>> +++ linux-next-20210917/include/soc/arc/timers.h
>> @@ -17,7 +17,7 @@
>>   #define ARC_REG_TIMER1_CNT	0x100	/* timer 1 count */
>>   
>>   /* CTRL reg bits */
>> -#define TIMER_CTRL_IE	        (1 << 0) /* Interrupt when Count reaches limit */
>> +#define TIMER_CTRL_IEN	        (1 << 0) /* Interrupt when Count reaches limit */
> 
> Could you change the name to "ARC_TIMER_CTRL_IE" instead? and while at it, please rename
> "TIMER_CTRL_NH" to "ARC_TIMER_CTRL_NH" for obvious consistency reasons and saving us
> from future clashes.  Thank you!
> 

OK, no problem.

Thanks for the feedback.

-- 
~Randy

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

end of thread, other threads:[~2021-09-23 15:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-23  3:18 [PATCH] clocksource: arc_timer: eliminate redefined macro error Randy Dunlap
2021-09-23  9:42 ` Shahab Vahedi
2021-09-23 15:29   ` Randy Dunlap

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).