clocksource/drivers/arm_arch_timer: Make symbol 'arch_timer_rate1' static
Subsystems (2)
PATCH 1/1 clocksource/drivers/arm_arch_timer: Make symbol 'arch_timer_rate1' static
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.
--- drivers/clocksource/arm_arch_timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clocksource/arm_arch_timer.c +1 -1
@@ -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 ] = {
Signature · 1 line
2.6.2
Marc Zyngier
maintainer[+ Jisheng Zhang]
Quoted 8 lines · 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.
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.
Quoted 24 lines
Reported-by Hulk Robot <[email protected]>Signed-off-by Zou Wei <[email protected]>--- drivers/clocksource/arm_arch_timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/clocksource/arm_arch_timer.c +1
-1@@ -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 ] = {Signature · 1 line
2.6.2
Signature · 1 line
Without deviation from the norm, progress is not possible.
Quoted 12 lines · On Tue, 11 May 2021 08:14:42 +0100 Marc Zyngier wrote:
[+ Jisheng Zhang]
Quoted 6 lines · 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?
Quoted 6 lines
Quoted 2 lines
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_initand__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.
Quoted 2 lines
Please post a patch removing this variable altogether.
Just sent out a patch to remove this variable.
Quoted 32 lines
Thanks,
M.Quoted 21 lines
Reported-by Hulk Robot <[email protected]>Signed-off-by Zou Wei <[email protected]>--- drivers/clocksource/arm_arch_timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/clocksource/arm_arch_timer.c +1
-2@@ -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 ] = { --Quoted 3 lines
2.6.2
--
Without deviation from the norm, progress is not possible.