[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181203083329.GG11614@hirez.programming.kicks-ass.net>
Date: Mon, 3 Dec 2018 09:33:29 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Wen Yang <wen.yang99@....com.cn>
Cc: Ingo Molnar <mingo@...hat.com>, linux-kernel@...r.kernel.org,
zhong.weidong@....com.cn
Subject: Re: [PATCH] sched/fair: Fix assignment of boolean variables
On Sat, Dec 01, 2018 at 05:09:36PM +0800, Wen Yang wrote:
> Fix the following warnings reported by coccinelle:
> kernel//sched/fair.c:7958:3-12: WARNING: Assignment of bool to 0/1
>
> This also makes the code more readable.
I disagree; anybody that has trouble with 0/1 vs false/true needs to
stay away from C.
> Signed-off-by: Wen Yang <wen.yang99@....com.cn>
> CC: Ingo Molnar <mingo@...hat.com>
> CC: Peter Zijlstra <peterz@...radead.org>
> CC: linux-kernel@...r.kernel.org
> ---
> kernel/sched/fair.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index a2e8160968cb..f19aa66f9b15 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -7955,7 +7955,7 @@ static inline void update_sg_lb_stats(struct lb_env *env,
> if (env->sd->flags & SD_ASYM_CPUCAPACITY &&
> sgs->group_misfit_task_load < rq->misfit_task_load) {
> sgs->group_misfit_task_load = rq->misfit_task_load;
> - *overload = 1;
> + *overload = true;
> }
> }
>
Anyway, this code is going away anyway:
https://lkml.kernel.org/r/20181119141857.8625-12-quentin.perret@arm.com
Powered by blists - more mailing lists