2020-11-25 02:21:45

by Zou Wei

[permalink] [raw]
Subject: [PATCH -next v2] sched/topology: Mark some symbols with static keyword

Fix the following sparse warnings:

kernel/sched/topology.c:211:1: warning: symbol 'sched_energy_mutex' was not declared. Should it be static?
kernel/sched/topology.c:212:6: warning: symbol 'sched_energy_update' was not declared. Should it be static?

Fixes: 31f6a8c0a471 ("sched/topology,schedutil: Wrap sched domains rebuild")
Signed-off-by: Zou Wei <[email protected]>
---
kernel/sched/topology.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c
index 5d3675c..2676687 100644
--- a/kernel/sched/topology.c
+++ b/kernel/sched/topology.c
@@ -208,8 +208,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);
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)
{
--
2.6.2


2021-02-02 21:24:46

by Ionela Voinescu

[permalink] [raw]
Subject: Re: [PATCH -next v2] sched/topology: Mark some symbols with static keyword

Hi,

+Xuewen Yan, who submitted a similar patch recently.

On Wednesday 25 Nov 2020 at 10:30:47 (+0800), Zou Wei wrote:
> Fix the following sparse warnings:
>
> kernel/sched/topology.c:211:1: warning: symbol 'sched_energy_mutex' was not declared. Should it be static?
> kernel/sched/topology.c:212:6: warning: symbol 'sched_energy_update' was not declared. Should it be static?
>
> Fixes: 31f6a8c0a471 ("sched/topology,schedutil: Wrap sched domains rebuild")
> Signed-off-by: Zou Wei <[email protected]>
> ---
> kernel/sched/topology.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c
> index 5d3675c..2676687 100644
> --- a/kernel/sched/topology.c
> +++ b/kernel/sched/topology.c
> @@ -208,8 +208,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);
> 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;
>

Reviewed-by: Ionela Voinescu <[email protected]>

Apologies for introducing these warnings with my previous patch.

Kind regards,
Ionela.

> void rebuild_sched_domains_energy(void)
> {
> --
> 2.6.2
>