2023-04-05 16:45:03

by Tom Rix

[permalink] [raw]
Subject: [PATCH] sched/psi: set varaiable psi_cgroups_enabled storage-class-specifier to static

smatch reports
kernel/sched/psi.c:143:1: warning: symbol
'psi_cgroups_enabled' was not declared. Should it be static?

This variable is only used in one file so should be static.

Signed-off-by: Tom Rix <[email protected]>
---
kernel/sched/psi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/sched/psi.c b/kernel/sched/psi.c
index 02e011cabe91..c8a556eb9f8a 100644
--- a/kernel/sched/psi.c
+++ b/kernel/sched/psi.c
@@ -140,7 +140,7 @@
static int psi_bug __read_mostly;

DEFINE_STATIC_KEY_FALSE(psi_disabled);
-DEFINE_STATIC_KEY_TRUE(psi_cgroups_enabled);
+static DEFINE_STATIC_KEY_TRUE(psi_cgroups_enabled);

#ifdef CONFIG_PSI_DEFAULT_DISABLED
static bool psi_enable;
--
2.27.0


2023-04-05 16:48:37

by Johannes Weiner

[permalink] [raw]
Subject: Re: [PATCH] sched/psi: set varaiable psi_cgroups_enabled storage-class-specifier to static

On Wed, Apr 05, 2023 at 12:36:02PM -0400, Tom Rix wrote:
> smatch reports
> kernel/sched/psi.c:143:1: warning: symbol
> 'psi_cgroups_enabled' was not declared. Should it be static?
>
> This variable is only used in one file so should be static.
>
> Signed-off-by: Tom Rix <[email protected]>

Acked-by: Johannes Weiner <[email protected]>

2023-04-05 18:41:09

by Suren Baghdasaryan

[permalink] [raw]
Subject: Re: [PATCH] sched/psi: set varaiable psi_cgroups_enabled storage-class-specifier to static

On Wed, Apr 5, 2023 at 9:46 AM Johannes Weiner <[email protected]> wrote:
>
> On Wed, Apr 05, 2023 at 12:36:02PM -0400, Tom Rix wrote:
> > smatch reports
> > kernel/sched/psi.c:143:1: warning: symbol
> > 'psi_cgroups_enabled' was not declared. Should it be static?
> >
> > This variable is only used in one file so should be static.
> >
> > Signed-off-by: Tom Rix <[email protected]>
>
> Acked-by: Johannes Weiner <[email protected]>

Acked-by: Suren Baghdasaryan <[email protected]>