linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] powerpc: kernel/time.c - cleanup warnings
@ 2021-03-17 10:34 He Ying
  2021-03-17 11:16 ` Christophe Leroy
  0 siblings, 1 reply; 6+ messages in thread
From: He Ying @ 2021-03-17 10:34 UTC (permalink / raw)
  To: mpe, benh, paulus, christophe.leroy, npiggin, msuchanek,
	heying24, peterz, geert+renesas, kernelfans, frederic
  Cc: linuxppc-dev, linux-kernel

We found these warnings in arch/powerpc/kernel/time.c as follows:
warning: symbol 'decrementer_max' was not declared. Should it be static?
warning: symbol 'rtc_lock' was not declared. Should it be static?
warning: symbol 'dtl_consumer' was not declared. Should it be static?

Declare 'decrementer_max' in arch/powerpc/include/asm/time.h. And include
proper header in which 'rtc_lock' is declared. Move 'dtl_consumer'
definition behind "include <asm/dtl.h>" because 'dtl_consumer' is declared
there.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: He Ying <heying24@huawei.com>
---
 arch/powerpc/include/asm/time.h | 1 +
 arch/powerpc/kernel/time.c      | 7 +++----
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/include/asm/time.h b/arch/powerpc/include/asm/time.h
index 8dd3cdb25338..2cd2b50bedda 100644
--- a/arch/powerpc/include/asm/time.h
+++ b/arch/powerpc/include/asm/time.h
@@ -22,6 +22,7 @@ extern unsigned long tb_ticks_per_jiffy;
 extern unsigned long tb_ticks_per_usec;
 extern unsigned long tb_ticks_per_sec;
 extern struct clock_event_device decrementer_clockevent;
+extern u64 decrementer_max;
 
 
 extern void generic_calibrate_decr(void);
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
index b67d93a609a2..409967713ca6 100644
--- a/arch/powerpc/kernel/time.c
+++ b/arch/powerpc/kernel/time.c
@@ -55,6 +55,7 @@
 #include <linux/sched/cputime.h>
 #include <linux/sched/clock.h>
 #include <linux/processor.h>
+#include <linux/mc146818rtc.h>
 #include <asm/trace.h>
 
 #include <asm/interrupt.h>
@@ -150,10 +151,6 @@ bool tb_invalid;
 u64 __cputime_usec_factor;
 EXPORT_SYMBOL(__cputime_usec_factor);
 
-#ifdef CONFIG_PPC_SPLPAR
-void (*dtl_consumer)(struct dtl_entry *, u64);
-#endif
-
 static void calc_cputime_factors(void)
 {
 	struct div_result res;
@@ -179,6 +176,8 @@ static inline unsigned long read_spurr(unsigned long tb)
 
 #include <asm/dtl.h>
 
+void (*dtl_consumer)(struct dtl_entry *, u64);
+
 /*
  * Scan the dispatch trace log and count up the stolen time.
  * Should be called with interrupts disabled.
-- 
2.17.1


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

* Re: [PATCH -next] powerpc: kernel/time.c - cleanup warnings
  2021-03-17 10:34 [PATCH -next] powerpc: kernel/time.c - cleanup warnings He Ying
@ 2021-03-17 11:16 ` Christophe Leroy
  2021-03-18  2:28   ` heying (H)
  0 siblings, 1 reply; 6+ messages in thread
From: Christophe Leroy @ 2021-03-17 11:16 UTC (permalink / raw)
  To: He Ying, mpe, benh, paulus, npiggin, msuchanek, peterz,
	geert+renesas, kernelfans, frederic
  Cc: linuxppc-dev, linux-kernel



Le 17/03/2021 à 11:34, He Ying a écrit :
> We found these warnings in arch/powerpc/kernel/time.c as follows:
> warning: symbol 'decrementer_max' was not declared. Should it be static?
> warning: symbol 'rtc_lock' was not declared. Should it be static?
> warning: symbol 'dtl_consumer' was not declared. Should it be static?
> 
> Declare 'decrementer_max' in arch/powerpc/include/asm/time.h. And include
> proper header in which 'rtc_lock' is declared. Move 'dtl_consumer'
> definition behind "include <asm/dtl.h>" because 'dtl_consumer' is declared
> there.
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: He Ying <heying24@huawei.com>
> ---
>   arch/powerpc/include/asm/time.h | 1 +
>   arch/powerpc/kernel/time.c      | 7 +++----
>   2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/powerpc/include/asm/time.h b/arch/powerpc/include/asm/time.h
> index 8dd3cdb25338..2cd2b50bedda 100644
> --- a/arch/powerpc/include/asm/time.h
> +++ b/arch/powerpc/include/asm/time.h
> @@ -22,6 +22,7 @@ extern unsigned long tb_ticks_per_jiffy;
>   extern unsigned long tb_ticks_per_usec;
>   extern unsigned long tb_ticks_per_sec;
>   extern struct clock_event_device decrementer_clockevent;
> +extern u64 decrementer_max;
>   
>   
>   extern void generic_calibrate_decr(void);
> diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
> index b67d93a609a2..409967713ca6 100644
> --- a/arch/powerpc/kernel/time.c
> +++ b/arch/powerpc/kernel/time.c
> @@ -55,6 +55,7 @@
>   #include <linux/sched/cputime.h>
>   #include <linux/sched/clock.h>
>   #include <linux/processor.h>
> +#include <linux/mc146818rtc.h>

I don't think that's the good place. It has no link to powerpc, it is only by chance that it has the 
same name.

As rtc_lock is defined in powerpc time.c, I think you should declare it in powerpc asm/time.h


>   #include <asm/trace.h>
>   
>   #include <asm/interrupt.h>
> @@ -150,10 +151,6 @@ bool tb_invalid;
>   u64 __cputime_usec_factor;
>   EXPORT_SYMBOL(__cputime_usec_factor);
>   
> -#ifdef CONFIG_PPC_SPLPAR
> -void (*dtl_consumer)(struct dtl_entry *, u64);
> -#endif
> -
>   static void calc_cputime_factors(void)
>   {
>   	struct div_result res;
> @@ -179,6 +176,8 @@ static inline unsigned long read_spurr(unsigned long tb)
>   
>   #include <asm/dtl.h>
>   
> +void (*dtl_consumer)(struct dtl_entry *, u64);
> +
>   /*
>    * Scan the dispatch trace log and count up the stolen time.
>    * Should be called with interrupts disabled.
> 

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

* Re: [PATCH -next] powerpc: kernel/time.c - cleanup warnings
  2021-03-17 11:16 ` Christophe Leroy
@ 2021-03-18  2:28   ` heying (H)
  2021-03-23  6:21     ` heying (H)
  0 siblings, 1 reply; 6+ messages in thread
From: heying (H) @ 2021-03-18  2:28 UTC (permalink / raw)
  To: Christophe Leroy, mpe, benh, paulus, npiggin, msuchanek, peterz,
	geert+renesas, kernelfans, frederic
  Cc: linuxppc-dev, linux-kernel


在 2021/3/17 19:16, Christophe Leroy 写道:
>
>
> Le 17/03/2021 à 11:34, He Ying a écrit :
>> We found these warnings in arch/powerpc/kernel/time.c as follows:
>> warning: symbol 'decrementer_max' was not declared. Should it be static?
>> warning: symbol 'rtc_lock' was not declared. Should it be static?
>> warning: symbol 'dtl_consumer' was not declared. Should it be static?
>>
>> Declare 'decrementer_max' in arch/powerpc/include/asm/time.h. And 
>> include
>> proper header in which 'rtc_lock' is declared. Move 'dtl_consumer'
>> definition behind "include <asm/dtl.h>" because 'dtl_consumer' is 
>> declared
>> there.
>>
>> Reported-by: Hulk Robot <hulkci@huawei.com>
>> Signed-off-by: He Ying <heying24@huawei.com>
>> ---
>>   arch/powerpc/include/asm/time.h | 1 +
>>   arch/powerpc/kernel/time.c      | 7 +++----
>>   2 files changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/arch/powerpc/include/asm/time.h 
>> b/arch/powerpc/include/asm/time.h
>> index 8dd3cdb25338..2cd2b50bedda 100644
>> --- a/arch/powerpc/include/asm/time.h
>> +++ b/arch/powerpc/include/asm/time.h
>> @@ -22,6 +22,7 @@ extern unsigned long tb_ticks_per_jiffy;
>>   extern unsigned long tb_ticks_per_usec;
>>   extern unsigned long tb_ticks_per_sec;
>>   extern struct clock_event_device decrementer_clockevent;
>> +extern u64 decrementer_max;
>>       extern void generic_calibrate_decr(void);
>> diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
>> index b67d93a609a2..409967713ca6 100644
>> --- a/arch/powerpc/kernel/time.c
>> +++ b/arch/powerpc/kernel/time.c
>> @@ -55,6 +55,7 @@
>>   #include <linux/sched/cputime.h>
>>   #include <linux/sched/clock.h>
>>   #include <linux/processor.h>
>> +#include <linux/mc146818rtc.h>
>
> I don't think that's the good place. It has no link to powerpc, it is 
> only by chance that it has the same name.
>
> As rtc_lock is defined in powerpc time.c, I think you should declare 
> it in powerpc asm/time.h

My first thought was the same as yours. I tried to add declaration in 
powerpc asm/time.h, but got a compiling error:

drivers/rtc/rtc-vr41xx.c:75:24: error: static declaration of ‘rtc_lock’ 
follows non-static declaration
  static DEFINE_SPINLOCK(rtc_lock);

In file included from ./arch/powerpc/include/asm/delay.h:7:0,
                  from ./arch/powerpc/include/asm/io.h:33,
                  from ./include/linux/io.h:13,
                  from drivers/rtc/rtc-vr41xx.c:11:
./arch/powerpc/include/asm/time.h:25:19: note: previous declaration of 
‘rtc_lock’ was here
  extern spinlock_t rtc_lock;

There's a conflict. Perhaps I can rename it in drivers/rtc/rtc-vr41xx.c.


But I find an existing declaration in linux/mc146818rtc.h and there's 
only one definition for 'rtc_lock' in powerpc.

There's some includes of mc146818rtc.h in powperc. I wonder they point 
to the same thing. But I'm not very sure

because the header's name looks a bit strange.

>
>
>>   #include <asm/trace.h>
>>     #include <asm/interrupt.h>
>> @@ -150,10 +151,6 @@ bool tb_invalid;
>>   u64 __cputime_usec_factor;
>>   EXPORT_SYMBOL(__cputime_usec_factor);
>>   -#ifdef CONFIG_PPC_SPLPAR
>> -void (*dtl_consumer)(struct dtl_entry *, u64);
>> -#endif
>> -
>>   static void calc_cputime_factors(void)
>>   {
>>       struct div_result res;
>> @@ -179,6 +176,8 @@ static inline unsigned long read_spurr(unsigned 
>> long tb)
>>     #include <asm/dtl.h>
>>   +void (*dtl_consumer)(struct dtl_entry *, u64);
>> +
>>   /*
>>    * Scan the dispatch trace log and count up the stolen time.
>>    * Should be called with interrupts disabled.
>>
> .

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

* Re: [PATCH -next] powerpc: kernel/time.c - cleanup warnings
  2021-03-18  2:28   ` heying (H)
@ 2021-03-23  6:21     ` heying (H)
  2021-03-23  6:33       ` Christophe Leroy
  0 siblings, 1 reply; 6+ messages in thread
From: heying (H) @ 2021-03-23  6:21 UTC (permalink / raw)
  To: Christophe Leroy, mpe, benh, paulus, npiggin, msuchanek, peterz,
	geert+renesas, kernelfans, frederic
  Cc: linuxppc-dev, linux-kernel

Dear Christophe,


在 2021/3/18 10:28, heying (H) 写道:
>
> 在 2021/3/17 19:16, Christophe Leroy 写道:
>>
>>
>> Le 17/03/2021 à 11:34, He Ying a écrit :
>>> We found these warnings in arch/powerpc/kernel/time.c as follows:
>>> warning: symbol 'decrementer_max' was not declared. Should it be 
>>> static?
>>> warning: symbol 'rtc_lock' was not declared. Should it be static?
>>> warning: symbol 'dtl_consumer' was not declared. Should it be static?
>>>
>>> Declare 'decrementer_max' in arch/powerpc/include/asm/time.h. And 
>>> include
>>> proper header in which 'rtc_lock' is declared. Move 'dtl_consumer'
>>> definition behind "include <asm/dtl.h>" because 'dtl_consumer' is 
>>> declared
>>> there.
>>>
>>> Reported-by: Hulk Robot <hulkci@huawei.com>
>>> Signed-off-by: He Ying <heying24@huawei.com>
>>> ---
>>>   arch/powerpc/include/asm/time.h | 1 +
>>>   arch/powerpc/kernel/time.c      | 7 +++----
>>>   2 files changed, 4 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/arch/powerpc/include/asm/time.h 
>>> b/arch/powerpc/include/asm/time.h
>>> index 8dd3cdb25338..2cd2b50bedda 100644
>>> --- a/arch/powerpc/include/asm/time.h
>>> +++ b/arch/powerpc/include/asm/time.h
>>> @@ -22,6 +22,7 @@ extern unsigned long tb_ticks_per_jiffy;
>>>   extern unsigned long tb_ticks_per_usec;
>>>   extern unsigned long tb_ticks_per_sec;
>>>   extern struct clock_event_device decrementer_clockevent;
>>> +extern u64 decrementer_max;
>>>       extern void generic_calibrate_decr(void);
>>> diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
>>> index b67d93a609a2..409967713ca6 100644
>>> --- a/arch/powerpc/kernel/time.c
>>> +++ b/arch/powerpc/kernel/time.c
>>> @@ -55,6 +55,7 @@
>>>   #include <linux/sched/cputime.h>
>>>   #include <linux/sched/clock.h>
>>>   #include <linux/processor.h>
>>> +#include <linux/mc146818rtc.h>
>>
>> I don't think that's the good place. It has no link to powerpc, it is 
>> only by chance that it has the same name.
>>
>> As rtc_lock is defined in powerpc time.c, I think you should declare 
>> it in powerpc asm/time.h
>
> My first thought was the same as yours. I tried to add declaration in 
> powerpc asm/time.h, but got a compiling error:
>
> drivers/rtc/rtc-vr41xx.c:75:24: error: static declaration of 
> ‘rtc_lock’ follows non-static declaration
>  static DEFINE_SPINLOCK(rtc_lock);
>
> In file included from ./arch/powerpc/include/asm/delay.h:7:0,
>                  from ./arch/powerpc/include/asm/io.h:33,
>                  from ./include/linux/io.h:13,
>                  from drivers/rtc/rtc-vr41xx.c:11:
> ./arch/powerpc/include/asm/time.h:25:19: note: previous declaration of 
> ‘rtc_lock’ was here
>  extern spinlock_t rtc_lock;
>
> There's a conflict. Perhaps I can rename it in drivers/rtc/rtc-vr41xx.c.
>
>
> But I find an existing declaration in linux/mc146818rtc.h and there's 
> only one definition for 'rtc_lock' in powerpc.
>
> There's some includes of mc146818rtc.h in powperc. I wonder they point 
> to the same thing. But I'm not very sure
>
> because the header's name looks a bit strange.

How about including mc146818rtc.h in powperpc kernel/time.c? May I have 
your opinions please?


Thanks.



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

* Re: [PATCH -next] powerpc: kernel/time.c - cleanup warnings
  2021-03-23  6:21     ` heying (H)
@ 2021-03-23  6:33       ` Christophe Leroy
  2021-03-23  6:53         ` heying (H)
  0 siblings, 1 reply; 6+ messages in thread
From: Christophe Leroy @ 2021-03-23  6:33 UTC (permalink / raw)
  To: heying (H),
	mpe, benh, paulus, npiggin, msuchanek, peterz, geert+renesas,
	kernelfans, frederic
  Cc: linuxppc-dev, linux-kernel



Le 23/03/2021 à 07:21, heying (H) a écrit :
> Dear Christophe,
> 
> 
> 在 2021/3/18 10:28, heying (H) 写道:
>>
>> 在 2021/3/17 19:16, Christophe Leroy 写道:
>>>
>>>
>>> Le 17/03/2021 à 11:34, He Ying a écrit :
>>>> We found these warnings in arch/powerpc/kernel/time.c as follows:
>>>> warning: symbol 'decrementer_max' was not declared. Should it be static?
>>>> warning: symbol 'rtc_lock' was not declared. Should it be static?
>>>> warning: symbol 'dtl_consumer' was not declared. Should it be static?
>>>>
>>>> Declare 'decrementer_max' in arch/powerpc/include/asm/time.h. And include
>>>> proper header in which 'rtc_lock' is declared. Move 'dtl_consumer'
>>>> definition behind "include <asm/dtl.h>" because 'dtl_consumer' is declared
>>>> there.
>>>>
>>>> Reported-by: Hulk Robot <hulkci@huawei.com>
>>>> Signed-off-by: He Ying <heying24@huawei.com>
>>>> ---
>>>>   arch/powerpc/include/asm/time.h | 1 +
>>>>   arch/powerpc/kernel/time.c      | 7 +++----
>>>>   2 files changed, 4 insertions(+), 4 deletions(-)
>>>>
>>>> diff --git a/arch/powerpc/include/asm/time.h b/arch/powerpc/include/asm/time.h
>>>> index 8dd3cdb25338..2cd2b50bedda 100644
>>>> --- a/arch/powerpc/include/asm/time.h
>>>> +++ b/arch/powerpc/include/asm/time.h
>>>> @@ -22,6 +22,7 @@ extern unsigned long tb_ticks_per_jiffy;
>>>>   extern unsigned long tb_ticks_per_usec;
>>>>   extern unsigned long tb_ticks_per_sec;
>>>>   extern struct clock_event_device decrementer_clockevent;
>>>> +extern u64 decrementer_max;
>>>>       extern void generic_calibrate_decr(void);
>>>> diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
>>>> index b67d93a609a2..409967713ca6 100644
>>>> --- a/arch/powerpc/kernel/time.c
>>>> +++ b/arch/powerpc/kernel/time.c
>>>> @@ -55,6 +55,7 @@
>>>>   #include <linux/sched/cputime.h>
>>>>   #include <linux/sched/clock.h>
>>>>   #include <linux/processor.h>
>>>> +#include <linux/mc146818rtc.h>
>>>
>>> I don't think that's the good place. It has no link to powerpc, it is only by chance that it has 
>>> the same name.
>>>
>>> As rtc_lock is defined in powerpc time.c, I think you should declare it in powerpc asm/time.h
>>
>> My first thought was the same as yours. I tried to add declaration in powerpc asm/time.h, but got 
>> a compiling error:
>>
>> drivers/rtc/rtc-vr41xx.c:75:24: error: static declaration of ‘rtc_lock’ follows non-static 
>> declaration
>>  static DEFINE_SPINLOCK(rtc_lock);
>>
>> In file included from ./arch/powerpc/include/asm/delay.h:7:0,
>>                  from ./arch/powerpc/include/asm/io.h:33,
>>                  from ./include/linux/io.h:13,
>>                  from drivers/rtc/rtc-vr41xx.c:11:
>> ./arch/powerpc/include/asm/time.h:25:19: note: previous declaration of ‘rtc_lock’ was here
>>  extern spinlock_t rtc_lock;
>>
>> There's a conflict. Perhaps I can rename it in drivers/rtc/rtc-vr41xx.c.
>>
>>
>> But I find an existing declaration in linux/mc146818rtc.h and there's only one definition for 
>> 'rtc_lock' in powerpc.
>>
>> There's some includes of mc146818rtc.h in powperc. I wonder they point to the same thing. But I'm 
>> not very sure
>>
>> because the header's name looks a bit strange.
> 
> How about including mc146818rtc.h in powperpc kernel/time.c? May I have your opinions please?
> 

As I said, mc146818rtc.h is not related to powerpc, and if it works that's just chance, and there is 
no certainty that it will still work in the future.

If you can't find a clean solution, it is better to leave the warning.

Christophe

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

* Re: [PATCH -next] powerpc: kernel/time.c - cleanup warnings
  2021-03-23  6:33       ` Christophe Leroy
@ 2021-03-23  6:53         ` heying (H)
  0 siblings, 0 replies; 6+ messages in thread
From: heying (H) @ 2021-03-23  6:53 UTC (permalink / raw)
  To: Christophe Leroy, mpe, benh, paulus, npiggin, msuchanek, peterz,
	geert+renesas, kernelfans, frederic
  Cc: linuxppc-dev, linux-kernel

Dear Christophe,


在 2021/3/23 14:33, Christophe Leroy 写道:
>
>
> Le 23/03/2021 à 07:21, heying (H) a écrit :
>> Dear Christophe,
>>
>>
>> 在 2021/3/18 10:28, heying (H) 写道:
>>>
>>> 在 2021/3/17 19:16, Christophe Leroy 写道:
>>>>
>>>>
>>>> Le 17/03/2021 à 11:34, He Ying a écrit :
>>>>> We found these warnings in arch/powerpc/kernel/time.c as follows:
>>>>> warning: symbol 'decrementer_max' was not declared. Should it be 
>>>>> static?
>>>>> warning: symbol 'rtc_lock' was not declared. Should it be static?
>>>>> warning: symbol 'dtl_consumer' was not declared. Should it be static?
>>>>>
>>>>> Declare 'decrementer_max' in arch/powerpc/include/asm/time.h. And 
>>>>> include
>>>>> proper header in which 'rtc_lock' is declared. Move 'dtl_consumer'
>>>>> definition behind "include <asm/dtl.h>" because 'dtl_consumer' is 
>>>>> declared
>>>>> there.
>>>>>
>>>>> Reported-by: Hulk Robot <hulkci@huawei.com>
>>>>> Signed-off-by: He Ying <heying24@huawei.com>
>>>>> ---
>>>>>   arch/powerpc/include/asm/time.h | 1 +
>>>>>   arch/powerpc/kernel/time.c      | 7 +++----
>>>>>   2 files changed, 4 insertions(+), 4 deletions(-)
>>>>>
>>>>> diff --git a/arch/powerpc/include/asm/time.h 
>>>>> b/arch/powerpc/include/asm/time.h
>>>>> index 8dd3cdb25338..2cd2b50bedda 100644
>>>>> --- a/arch/powerpc/include/asm/time.h
>>>>> +++ b/arch/powerpc/include/asm/time.h
>>>>> @@ -22,6 +22,7 @@ extern unsigned long tb_ticks_per_jiffy;
>>>>>   extern unsigned long tb_ticks_per_usec;
>>>>>   extern unsigned long tb_ticks_per_sec;
>>>>>   extern struct clock_event_device decrementer_clockevent;
>>>>> +extern u64 decrementer_max;
>>>>>       extern void generic_calibrate_decr(void);
>>>>> diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c
>>>>> index b67d93a609a2..409967713ca6 100644
>>>>> --- a/arch/powerpc/kernel/time.c
>>>>> +++ b/arch/powerpc/kernel/time.c
>>>>> @@ -55,6 +55,7 @@
>>>>>   #include <linux/sched/cputime.h>
>>>>>   #include <linux/sched/clock.h>
>>>>>   #include <linux/processor.h>
>>>>> +#include <linux/mc146818rtc.h>
>>>>
>>>> I don't think that's the good place. It has no link to powerpc, it 
>>>> is only by chance that it has the same name.
>>>>
>>>> As rtc_lock is defined in powerpc time.c, I think you should 
>>>> declare it in powerpc asm/time.h
>>>
>>> My first thought was the same as yours. I tried to add declaration 
>>> in powerpc asm/time.h, but got a compiling error:
>>>
>>> drivers/rtc/rtc-vr41xx.c:75:24: error: static declaration of 
>>> ‘rtc_lock’ follows non-static declaration
>>>  static DEFINE_SPINLOCK(rtc_lock);
>>>
>>> In file included from ./arch/powerpc/include/asm/delay.h:7:0,
>>>                  from ./arch/powerpc/include/asm/io.h:33,
>>>                  from ./include/linux/io.h:13,
>>>                  from drivers/rtc/rtc-vr41xx.c:11:
>>> ./arch/powerpc/include/asm/time.h:25:19: note: previous declaration 
>>> of ‘rtc_lock’ was here
>>>  extern spinlock_t rtc_lock;
>>>
>>> There's a conflict. Perhaps I can rename it in 
>>> drivers/rtc/rtc-vr41xx.c.
>>>
>>>
>>> But I find an existing declaration in linux/mc146818rtc.h and 
>>> there's only one definition for 'rtc_lock' in powerpc.
>>>
>>> There's some includes of mc146818rtc.h in powperc. I wonder they 
>>> point to the same thing. But I'm not very sure
>>>
>>> because the header's name looks a bit strange.
>>
>> How about including mc146818rtc.h in powperpc kernel/time.c? May I 
>> have your opinions please?
>>
>
> As I said, mc146818rtc.h is not related to powerpc, and if it works 
> that's just chance, and there is no certainty that it will still work 
> in the future.
>
> If you can't find a clean solution, it is better to leave the warning.

OK. I see. Thanks for you relpy. I'll try to find some other better way.


Thanks.



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

end of thread, other threads:[~2021-03-23  6:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-17 10:34 [PATCH -next] powerpc: kernel/time.c - cleanup warnings He Ying
2021-03-17 11:16 ` Christophe Leroy
2021-03-18  2:28   ` heying (H)
2021-03-23  6:21     ` heying (H)
2021-03-23  6:33       ` Christophe Leroy
2021-03-23  6:53         ` heying (H)

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