mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Tang Yizhou <tangyizhou@huawei.com>
Cc: linux-kernel@vger.kernel.org, mingo@redhat.com,
	juri.lelli@redhat.com, vincent.guittot@linaro.org
Subject: Re: [PATCH 2/2] sched/pelt: Change the type of parameter running to bool
Date: Thu, 25 Nov 2021 10:55:54 +0100	[thread overview]
Message-ID: <YZ9dqgjSkA/Uv+7D@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20211125030019.10447-3-tangyizhou@huawei.com>

On Thu, Nov 25, 2021 at 11:00:19AM +0800, Tang Yizhou wrote:
> Parameter 'running' in function ___update_load_sum() and
> accumulate_sum() describes whether an se is running or not, so change
> the type of it to bool to make the code more readable.
> 
> Signed-off-by: Tang Yizhou <tangyizhou@huawei.com>
> ---
>  kernel/sched/pelt.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/sched/pelt.c b/kernel/sched/pelt.c
> index 3584df2a0b8e..2010b3bd6e49 100644
> --- a/kernel/sched/pelt.c
> +++ b/kernel/sched/pelt.c
> @@ -104,7 +104,7 @@ static u32 __accumulate_pelt_segments(u64 periods, u32 d1, u32 d3)
>   */
>  static __always_inline u32
>  accumulate_sum(u64 delta, struct sched_avg *sa,
> -	       unsigned long load, unsigned long runnable, int running)
> +	       unsigned long load, unsigned long runnable, bool running)
>  {
>  	u32 contrib = (u32)delta; /* p == 0 -> delta < 1024 */
>  	u64 periods;
> @@ -182,7 +182,7 @@ accumulate_sum(u64 delta, struct sched_avg *sa,
>   */
>  static __always_inline int
>  ___update_load_sum(u64 now, struct sched_avg *sa,
> -		  unsigned long load, unsigned long runnable, int running)
> +		  unsigned long load, unsigned long runnable, bool running)
>  {
>  	u64 delta;

And this function has:

	runnable = running = 0;

and then people complain about assigning 0 to _Bool, and then we get
idiocy like:

	runnable = running = false;

Please...

  reply	other threads:[~2021-11-25  9:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-25  3:00 [PATCH 0/2] Refactor some codes in sched/pelt.c Tang Yizhou
2021-11-25  3:00 ` [PATCH 1/2] sched/pelt: Remove redundant variable in __accumulate_pelt_segments Tang Yizhou
2021-11-25  9:53   ` Peter Zijlstra
2021-11-25  3:00 ` [PATCH 2/2] sched/pelt: Change the type of parameter running to bool Tang Yizhou
2021-11-25  9:55   ` Peter Zijlstra [this message]
2021-11-25 11:21     ` Tang Yizhou
2021-11-25 12:59     ` Tang Yizhou

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=YZ9dqgjSkA/Uv+7D@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tangyizhou@huawei.com \
    --cc=vincent.guittot@linaro.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®