lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YZ9dqgjSkA/Uv+7D@hirez.programming.kicks-ass.net>
Date:   Thu, 25 Nov 2021 10:55:54 +0100
From:   Peter Zijlstra <peterz@...radead.org>
To:     Tang Yizhou <tangyizhou@...wei.com>
Cc:     linux-kernel@...r.kernel.org, mingo@...hat.com,
        juri.lelli@...hat.com, vincent.guittot@...aro.org
Subject: Re: [PATCH 2/2] sched/pelt: Change the type of parameter running to
 bool

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@...wei.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...

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ