linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] clocksource/drivers/arm_arch_timer: Make symbol 'arch_timer_rate1' static
@ 2021-05-11  6:46 Zou Wei
  2021-05-11  7:14 ` Marc Zyngier
  0 siblings, 1 reply; 3+ messages in thread
From: Zou Wei @ 2021-05-11  6:46 UTC (permalink / raw)
  To: mark.rutland, maz, daniel.lezcano, tglx
  Cc: linux-arm-kernel, linux-kernel, Zou Wei

The sparse tool complains as follows:

drivers/clocksource/arm_arch_timer.c:67:5: warning:
 symbol 'arch_timer_rate1' was not declared. Should it be static?

This symbol is not used outside of arm_arch_timer.c, so marks it static.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zou Wei <zou_wei@huawei.com>
---
 drivers/clocksource/arm_arch_timer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
index fe1a826..800aaa9 100644
--- a/drivers/clocksource/arm_arch_timer.c
+++ b/drivers/clocksource/arm_arch_timer.c
@@ -64,7 +64,7 @@ struct arch_timer {
 #define to_arch_timer(e) container_of(e, struct arch_timer, evt)
 
 static u32 arch_timer_rate __ro_after_init;
-u32 arch_timer_rate1 __ro_after_init;
+static u32 arch_timer_rate1 __ro_after_init;
 static int arch_timer_ppi[ARCH_TIMER_MAX_TIMER_PPI] __ro_after_init;
 
 static const char *arch_timer_ppi_names[ARCH_TIMER_MAX_TIMER_PPI] = {
-- 
2.6.2


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

* Re: [PATCH -next] clocksource/drivers/arm_arch_timer: Make symbol 'arch_timer_rate1' static
  2021-05-11  6:46 [PATCH -next] clocksource/drivers/arm_arch_timer: Make symbol 'arch_timer_rate1' static Zou Wei
@ 2021-05-11  7:14 ` Marc Zyngier
  2021-05-11  7:53   ` Jisheng Zhang
  0 siblings, 1 reply; 3+ messages in thread
From: Marc Zyngier @ 2021-05-11  7:14 UTC (permalink / raw)
  To: Zou Wei
  Cc: mark.rutland, daniel.lezcano, tglx, linux-arm-kernel,
	linux-kernel, Jisheng Zhang

[+ Jisheng Zhang]

On Tue, 11 May 2021 07:46:23 +0100,
Zou Wei <zou_wei@huawei.com> wrote:
> 
> The sparse tool complains as follows:
> 
> drivers/clocksource/arm_arch_timer.c:67:5: warning:
>  symbol 'arch_timer_rate1' was not declared. Should it be static?
> 
> This symbol is not used outside of arm_arch_timer.c, so marks it
> static.

It is worse than that. This variable is not used *at all*, and has
been added by e2bf384d4329 ("clocksource/drivers/arm_arch_timer: Add
__ro_after_init and __init"). Not sure how we missed that.

Please post a patch removing this variable altogether.

Thanks,

	M.

> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Zou Wei <zou_wei@huawei.com>
> ---
>  drivers/clocksource/arm_arch_timer.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
> index fe1a826..800aaa9 100644
> --- a/drivers/clocksource/arm_arch_timer.c
> +++ b/drivers/clocksource/arm_arch_timer.c
> @@ -64,7 +64,7 @@ struct arch_timer {
>  #define to_arch_timer(e) container_of(e, struct arch_timer, evt)
>  
>  static u32 arch_timer_rate __ro_after_init;
> -u32 arch_timer_rate1 __ro_after_init;
> +static u32 arch_timer_rate1 __ro_after_init;
>  static int arch_timer_ppi[ARCH_TIMER_MAX_TIMER_PPI] __ro_after_init;
>  
>  static const char *arch_timer_ppi_names[ARCH_TIMER_MAX_TIMER_PPI] = {
> -- 
> 2.6.2
> 
> 

-- 
Without deviation from the norm, progress is not possible.

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

* Re: [PATCH -next] clocksource/drivers/arm_arch_timer: Make symbol 'arch_timer_rate1' static
  2021-05-11  7:14 ` Marc Zyngier
@ 2021-05-11  7:53   ` Jisheng Zhang
  0 siblings, 0 replies; 3+ messages in thread
From: Jisheng Zhang @ 2021-05-11  7:53 UTC (permalink / raw)
  To: Marc Zyngier
  Cc: Zou Wei, mark.rutland, daniel.lezcano, tglx, linux-arm-kernel,
	linux-kernel

On Tue, 11 May 2021 08:14:42 +0100 Marc Zyngier wrote:


> 
> 
> [+ Jisheng Zhang]
> 
> On Tue, 11 May 2021 07:46:23 +0100,
> Zou Wei <zou_wei@huawei.com> wrote:
> >
> > The sparse tool complains as follows:
> >
> > drivers/clocksource/arm_arch_timer.c:67:5: warning:
> >  symbol 'arch_timer_rate1' was not declared. Should it be static?
> >
> > This symbol is not used outside of arm_arch_timer.c, so marks it
> > static.  
> 
> It is worse than that. This variable is not used *at all*, and has
> been added by e2bf384d4329 ("clocksource/drivers/arm_arch_timer: Add
> __ro_after_init and __init"). Not sure how we missed that.

Oops, my mistake. Sorry for that. IIRC, I added the __ro_after_init
marker, then want to prove the effectiveness of __ro_after_init with
a new and non-used variable. But later forgot to remove it.

> 
> Please post a patch removing this variable altogether.

Just sent out a patch to remove this variable.

> 
> Thanks,
> 
>         M.
> 
> >
> > Reported-by: Hulk Robot <hulkci@huawei.com>
> > Signed-off-by: Zou Wei <zou_wei@huawei.com>
> > ---
> >  drivers/clocksource/arm_arch_timer.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
> > index fe1a826..800aaa9 100644
> > --- a/drivers/clocksource/arm_arch_timer.c
> > +++ b/drivers/clocksource/arm_arch_timer.c
> > @@ -64,7 +64,7 @@ struct arch_timer {
> >  #define to_arch_timer(e) container_of(e, struct arch_timer, evt)
> >
> >  static u32 arch_timer_rate __ro_after_init;
> > -u32 arch_timer_rate1 __ro_after_init;
> > +static u32 arch_timer_rate1 __ro_after_init;
> >  static int arch_timer_ppi[ARCH_TIMER_MAX_TIMER_PPI] __ro_after_init;
> >
> >  static const char *arch_timer_ppi_names[ARCH_TIMER_MAX_TIMER_PPI] = {
> > --
> > 2.6.2
> >
> >  
> 
> --
> Without deviation from the norm, progress is not possible.


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

end of thread, other threads:[~2021-05-11  7:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-11  6:46 [PATCH -next] clocksource/drivers/arm_arch_timer: Make symbol 'arch_timer_rate1' static Zou Wei
2021-05-11  7:14 ` Marc Zyngier
2021-05-11  7:53   ` Jisheng Zhang

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