2023-07-02 13:44:15

by Tom Rix

[permalink] [raw]
Subject: [PATCH] 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.

Signed-off-by: Tom Rix <[email protected]>
---
drivers/clocksource/timer-loongson1-pwm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clocksource/timer-loongson1-pwm.c b/drivers/clocksource/timer-loongson1-pwm.c
index 6335fee03017..244d66835508 100644
--- a/drivers/clocksource/timer-loongson1-pwm.c
+++ b/drivers/clocksource/timer-loongson1-pwm.c
@@ -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;
--
2.27.0



2023-07-03 07:33:38

by Keguang Zhang

[permalink] [raw]
Subject: Re: [PATCH] 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.
>
> Signed-off-by: Tom Rix <[email protected]>

Acked-by: Keguang Zhang <[email protected]>

> ---
> drivers/clocksource/timer-loongson1-pwm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/clocksource/timer-loongson1-pwm.c b/drivers/clocksource/timer-loongson1-pwm.c
> index 6335fee03017..244d66835508 100644
> --- a/drivers/clocksource/timer-loongson1-pwm.c
> +++ b/drivers/clocksource/timer-loongson1-pwm.c
> @@ -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;
> --
> 2.27.0
>


--
Best regards,

Keguang Zhang