sched/topology: set varaiables sched_energy_mutex,update storage-class-specifier to static

Message ID 20230314144818.1453523-1-trix@redhat.com
State New
Headers
Series sched/topology: set varaiables sched_energy_mutex,update storage-class-specifier to static |

Commit Message

Tom Rix March 14, 2023, 2:48 p.m. UTC
  smatch reports
kernel/sched/topology.c:212:1: warning:
  symbol 'sched_energy_mutex' was not declared. Should it be static?
kernel/sched/topology.c:213:6: warning:
  symbol 'sched_energy_update' was not declared. Should it be static?

These variables are only used in topology.c, so should be static

Signed-off-by: Tom Rix <trix@redhat.com>
---
 kernel/sched/topology.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Valentin Schneider March 15, 2023, 4:21 p.m. UTC | #1
On 14/03/23 10:48, Tom Rix wrote:
> smatch reports
> kernel/sched/topology.c:212:1: warning:
>   symbol 'sched_energy_mutex' was not declared. Should it be static?
> kernel/sched/topology.c:213:6: warning:
>   symbol 'sched_energy_update' was not declared. Should it be static?
>
> These variables are only used in topology.c, so should be static
>
> Signed-off-by: Tom Rix <trix@redhat.com>

Reviewed-by: Valentin Schneider <vschneid@redhat.com>
  
Peter Zijlstra March 20, 2023, 10:39 a.m. UTC | #2
On Tue, Mar 14, 2023 at 10:48:18AM -0400, Tom Rix wrote:
> smatch reports
> kernel/sched/topology.c:212:1: warning:
>   symbol 'sched_energy_mutex' was not declared. Should it be static?
> kernel/sched/topology.c:213:6: warning:
>   symbol 'sched_energy_update' was not declared. Should it be static?
> 
> These variables are only used in topology.c, so should be static
> 
> Signed-off-by: Tom Rix <trix@redhat.com>

Thanks!
  

Patch

diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c
index 051aaf65c749..6682535e37c8 100644
--- a/kernel/sched/topology.c
+++ b/kernel/sched/topology.c
@@ -209,8 +209,8 @@  sd_parent_degenerate(struct sched_domain *sd, struct sched_domain *parent)
 #if defined(CONFIG_ENERGY_MODEL) && defined(CONFIG_CPU_FREQ_GOV_SCHEDUTIL)
 DEFINE_STATIC_KEY_FALSE(sched_energy_present);
 static unsigned int sysctl_sched_energy_aware = 1;
-DEFINE_MUTEX(sched_energy_mutex);
-bool sched_energy_update;
+static DEFINE_MUTEX(sched_energy_mutex);
+static bool sched_energy_update;
 
 void rebuild_sched_domains_energy(void)
 {