2021-05-28 09:04:36

by GONG, Ruiqi

[permalink] [raw]
Subject: [PATCH -next] MIPS: pm-cps: Make '__pcpu_scope_cps_cpu_state' static

Mark the per-CPU definition of cps_cpu_state as static to fix the following
sparse tool complain:

arch/mips/kernel/pm-cps.c:66:1: warning:
symbol '__pcpu_scope_cps_cpu_state' was not declared. Should it be static?

Reported-by: Hulk Robot <[email protected]>
Signed-off-by: Ruiqi Gong <[email protected]>
---
arch/mips/kernel/pm-cps.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/mips/kernel/pm-cps.c b/arch/mips/kernel/pm-cps.c
index 9bf60d7d44d3..32e8f0673e06 100644
--- a/arch/mips/kernel/pm-cps.c
+++ b/arch/mips/kernel/pm-cps.c
@@ -63,7 +63,7 @@ static DEFINE_PER_CPU_ALIGNED(cpumask_t, online_coupled);
static DEFINE_PER_CPU_ALIGNED(atomic_t, pm_barrier);

/* Saved CPU state across the CPS_PM_POWER_GATED state */
-DEFINE_PER_CPU_ALIGNED(struct mips_static_suspend_state, cps_cpu_state);
+static DEFINE_PER_CPU_ALIGNED(struct mips_static_suspend_state, cps_cpu_state);

/* A somewhat arbitrary number of labels & relocs for uasm */
static struct uasm_label labels[32];


2021-06-01 09:53:48

by Thomas Bogendoerfer

[permalink] [raw]
Subject: Re: [PATCH -next] MIPS: pm-cps: Make '__pcpu_scope_cps_cpu_state' static

On Fri, May 28, 2021 at 03:04:37PM +0800, Ruiqi Gong wrote:
> Mark the per-CPU definition of cps_cpu_state as static to fix the following
> sparse tool complain:
>
> arch/mips/kernel/pm-cps.c:66:1: warning:
> symbol '__pcpu_scope_cps_cpu_state' was not declared. Should it be static?

did you compile/link a kernel with this patch ? I doubt that since there
is a refernec to this symbol in arch/mips/kernel/cps-vec.S.

Thomas.

--
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea. [ RFC1925, 2.3 ]