All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dietmar Eggemann <dietmar.eggemann@arm.com>
To: Tom Rix <trix@redhat.com>,
	mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com,
	vincent.guittot@linaro.org, rostedt@goodmis.org,
	bsegall@google.com, mgorman@suse.de, bristot@redhat.com,
	vschneid@redhat.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sched/fair: rename variable cpu_util eff_util
Date: Mon, 12 Jun 2023 17:58:52 +0200	[thread overview]
Message-ID: <e4672cee-6bec-d20e-bfcf-f701fc6a45c6@arm.com> (raw)
In-Reply-To: <20230611122535.183654-1-trix@redhat.com>

On 11/06/2023 14:25, Tom Rix wrote:
> cppcheck reports
> kernel/sched/fair.c:7436:17: style: Local variable 'cpu_util' shadows outer function [shadowFunction]
>   unsigned long cpu_util;
>                 ^
> 
> Clean this up by renaming the variable to eff_util
> 
> Signed-off-by: Tom Rix <trix@redhat.com>
> ---
>  kernel/sched/fair.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index 6189d1a45635..7666dbc2b788 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -7433,7 +7433,7 @@ eenv_pd_max_util(struct energy_env *eenv, struct cpumask *pd_cpus,
>  	for_each_cpu(cpu, pd_cpus) {
>  		struct task_struct *tsk = (cpu == dst_cpu) ? p : NULL;
>  		unsigned long util = cpu_util(cpu, p, dst_cpu, 1);
> -		unsigned long cpu_util;
> +		unsigned long eff_util;
>  
>  		/*
>  		 * Performance domain frequency: utilization clamping
> @@ -7442,8 +7442,8 @@ eenv_pd_max_util(struct energy_env *eenv, struct cpumask *pd_cpus,
>  		 * NOTE: in case RT tasks are running, by default the
>  		 * FREQUENCY_UTIL's utilization can be max OPP.
>  		 */
> -		cpu_util = effective_cpu_util(cpu, util, FREQUENCY_UTIL, tsk);
> -		max_util = max(max_util, cpu_util);
> +		eff_util = effective_cpu_util(cpu, util, FREQUENCY_UTIL, tsk);
> +		max_util = max(max_util, eff_util);
>  	}
>  
>  	return min(max_util, eenv->cpu_cap);

I forgot to check this in patch 'sched/fair: Refactor CPU utilization
functions' when I replaced cpu_util_next() with cpu_util().

Reviewed-by: Dietmar Eggemann <dietmar.eggemann@arm.com>



  parent reply	other threads:[~2023-06-12 16:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-11 12:25 [PATCH] sched/fair: rename variable cpu_util eff_util Tom Rix
2023-06-12 15:44 ` Valentin Schneider
2023-06-12 15:58 ` Dietmar Eggemann [this message]
2023-06-15 11:38 ` [tip: sched/core] sched/fair: Rename " tip-bot2 for Tom Rix
2023-06-16 15:16 ` tip-bot2 for Tom Rix

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e4672cee-6bec-d20e-bfcf-f701fc6a45c6@arm.com \
    --to=dietmar.eggemann@arm.com \
    --cc=bristot@redhat.com \
    --cc=bsegall@google.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=trix@redhat.com \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.