Skip to contentSkip to conversation

clocksource/drivers/loongson1: set variable ls1x_timer_lock storage-class-specifier to static

PATCH Applied Tom Rix 3 participants 3 messages Jul 2, 2023 – Aug 31, 2023

Subsystems (3)
lore
Share & tools
lore

Tom Rix

author
#0 lore raw

PATCH 1/1 clocksource/drivers/loongson1: set variable ls1x_timer_lock storage-class-specifier to static

smatch reports drivers/clocksource/timer-loongson1-pwm.c:31:1: warning: symbol
'ls1x_timer_lock' was not declared. Should it be static?

This variable is only used in its defining file, so it should be static.

---
 drivers/clocksource/timer-loongson1-pwm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clocksource/timer-loongson1-pwm.c +1 -1
index 6335fee03017..244d66835508 100644
@@ -28,7 +28,7 @@
 
 #define CNTR_WIDTH		24
 
-DEFINE_RAW_SPINLOCK(ls1x_timer_lock);
+static DEFINE_RAW_SPINLOCK(ls1x_timer_lock);
 
 struct ls1x_clocksource {
 	void __iomem *reg_base;
Signature · 1 line
2.27.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines

smatch reports drivers/clocksource/timer-loongson1-pwm.c:31:1: warning: symbol
'ls1x_timer_lock' was not declared. Should it be static?

This variable is only used in its defining file, so it should be static.

Quoted 18 lines
---
 drivers/clocksource/timer-loongson1-pwm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clocksource/timer-loongson1-pwm.c +1 -2
index 6335fee03017..244d66835508 100644
@@ -28,7 +28,7 @@
 
 #define CNTR_WIDTH             24
 
-DEFINE_RAW_SPINLOCK(ls1x_timer_lock);
+static DEFINE_RAW_SPINLOCK(ls1x_timer_lock);
 
 struct ls1x_clocksource {
        void __iomem *reg_base;
--
Quoted 2 lines

2.27.0

--
Best regards,

Keguang Zhang

merge bot Applied
#2 lore raw

[tip: timers/core] clocksource/drivers/loongson1: Set variable ls1x_timer_lock storage-class-specifier to static

In reply to Tom Rix
The following commit has been merged into the timers/core branch of tip:

The following commit has been merged into the timers/core branch of tip:

Commit-ID:     bd0f3aac47e8f618ceae0120d7b989378a7c45f0
Gitweb:        https://git.kernel.org/tip/bd0f3aac47e8f618ceae0120d7b989378a7c45f0
Author:        Tom Rix <[email protected]>
AuthorDate:    Sun, 02 Jul 2023 09:31:13 -04:00
Committer:     Daniel Lezcano <[email protected]>
CommitterDate: Fri, 18 Aug 2023 12:13:03 +02:00

clocksource/drivers/loongson1: Set variable ls1x_timer_lock storage-class-specifier to static

smatch reports drivers/clocksource/timer-loongson1-pwm.c:31:1: warning: symbol
'ls1x_timer_lock' was not declared. Should it be static?

This variable is only used in its defining file, so it should be static.

---
 drivers/clocksource/timer-loongson1-pwm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clocksource/timer-loongson1-pwm.c +1 -1
index 6335fee..244d668 100644
@@ -28,7 +28,7 @@
 
 #define CNTR_WIDTH		24
 
-DEFINE_RAW_SPINLOCK(ls1x_timer_lock);
+static DEFINE_RAW_SPINLOCK(ls1x_timer_lock);
 
 struct ls1x_clocksource {
 	void __iomem *reg_base;