sched/psi: set varaiable psi_cgroups_enabled storage-class-specifier to static

Message ID 20230405163602.1939400-1-trix@redhat.com
State New
Headers
Series sched/psi: set varaiable psi_cgroups_enabled storage-class-specifier to static |

Commit Message

Tom Rix April 5, 2023, 4:36 p.m. UTC
  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 <trix@redhat.com>
---
 kernel/sched/psi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Johannes Weiner April 5, 2023, 4:46 p.m. UTC | #1
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 <trix@redhat.com>

Acked-by: Johannes Weiner <hannes@cmpxchg.org>
  
Suren Baghdasaryan April 5, 2023, 6:38 p.m. UTC | #2
On Wed, Apr 5, 2023 at 9:46 AM Johannes Weiner <hannes@cmpxchg.org> 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 <trix@redhat.com>
>
> Acked-by: Johannes Weiner <hannes@cmpxchg.org>

Acked-by: Suren Baghdasaryan <surenb@google.com>
  

Patch

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;