Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6750049imu; Mon, 3 Dec 2018 02:05:14 -0800 (PST) X-Google-Smtp-Source: AFSGD/Ws1GZcRCcvGUz7u5F4DgcoVBViMsTCNwZHtuZWXnAb8wI6Ezk53nDdi+7nCkvk8Ry2xg6N X-Received: by 2002:a17:902:6e16:: with SMTP id u22mr15128183plk.175.1543831514158; Mon, 03 Dec 2018 02:05:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543831514; cv=none; d=google.com; s=arc-20160816; b=1FeTttFZd1kQnQRQgnwVVcqXylBqfm/DrhVgkEKiUbuUSs/xYxNpC188EL2R70VoC0 fsy++Eg6mWV9xlyYGD3HG1Z6bmtkODKvM5bQVbGRe+y7cyKWAPXX4azR8/VlbxaoGLyY O9uCNjLMjrAfJWRY/PyCbGwttNzkbVGX2APSg97o+WwJPDbwOrmdnW6xO1e5MIeW4ov5 Cr26Bf6eShzvN9PtCs54yaN1sJ3sc/euJs/4eidSaPivoUJOFT+gkx/rYJnwxgJ33B6C 2c1DSHphLzIdaDhcZ3VW5qR7WW8QOoCwbarzWaw7xiXTtBY1nZ5lxqYsaTclEyuDLquL QuaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=EMeSbg2COZlmbqIh2YV1NUjoYOiPEKMJmWp9EMwGuec=; b=rmmP1KxMHT2gMiuKBYIris5u4FrYzoShRTNKxfJwcGaFTYQXwu8FDMYDojXEacnyL3 J2ZnqsRSEclvdV9z1GiFBR4g1PCNwLH/AmOZzNFm4xLGfS6xFGW00c97wJ1aQcNc48JT /jSr1K0T8C5VG1gMtO/wWNy9KtJ5V/ttvwFeZuMLTXlUXcv8nBOGtYmVXmdr7eFSMk4F /0E9SfC6q1Bzw+sWxH35gXKOfKJGowOfG2Q9pywp8QE44dx2lS81kKp3ChR1afD7zGgj LuHRoRPL0xqcp9bOrtq2LVw5tEjE8pZBTL3GgYnqCr3It1GVolYjJHbUmm/fJSCRhrQj KXkg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m187si13803988pfm.51.2018.12.03.02.04.44; Mon, 03 Dec 2018 02:05:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726146AbeLCKDu (ORCPT + 99 others); Mon, 3 Dec 2018 05:03:50 -0500 Received: from foss.arm.com ([217.140.101.70]:33136 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726002AbeLCKDt (ORCPT ); Mon, 3 Dec 2018 05:03:49 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1297280D; Mon, 3 Dec 2018 02:03:29 -0800 (PST) Received: from [10.1.194.37] (e113632-lin.cambridge.arm.com [10.1.194.37]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id F0AA03F59C; Mon, 3 Dec 2018 02:03:27 -0800 (PST) Subject: Re: [PATCH] sched/fair: Fix assignment of boolean variables To: Peter Zijlstra , Wen Yang Cc: Ingo Molnar , linux-kernel@vger.kernel.org, zhong.weidong@zte.com.cn, Patrick Bellasi References: <20181201090936.10175-1-wen.yang99@zte.com.cn> <20181203083329.GG11614@hirez.programming.kicks-ass.net> From: Valentin Schneider Message-ID: Date: Mon, 3 Dec 2018 10:03:26 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20181203083329.GG11614@hirez.programming.kicks-ass.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/12/2018 08:33, Peter Zijlstra wrote: > 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 >> Duh, Patrick raised that one to me last week but I got caught up in other things. I realized I could keep the local 'overload' as bool in 575638d1047e ("sched/core: Change root_domain->overload type to int") but probably forgot to update 757ffdd705ee ("sched/fair: Set rq->rd->overload when misfit") accordingly. >> 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 >> CC: Ingo Molnar >> CC: Peter Zijlstra >> CC: linux-kernel@vger.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 >