Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6688848imu; Mon, 3 Dec 2018 00:54:44 -0800 (PST) X-Google-Smtp-Source: AFSGD/XFWEfjtA7OFjksxphUGgnBqx1SjDYNnGniMaCpNZpFqKqs2j5jnEcxg6SLOPWsCScoagi7 X-Received: by 2002:a62:26c7:: with SMTP id m190mr15325351pfm.79.1543827284160; Mon, 03 Dec 2018 00:54:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543827284; cv=none; d=google.com; s=arc-20160816; b=JoBQ+289jJUdvg2nUHpuBdCZ3wKEDNYryHqsFAf5ePHj6kotVWreC2KBktKKGNFVq4 HkhA+CK1AhMcwAceVx0KpLyWuKrLQf0d+5H2t/tuwZOv3VngTU0cr1ljBmD7iM9QOxSH tFnr/twaoYvbIy0xxb363Dv/lytNEm0NteN3O4i4KZ5AQpBjkQJZApb7agRyqc20Hul5 //77MLQTwsmegSJNcwljG/TNU7I3O4SsybfJ4GFo39v+9QaTuB65TRfpOVG0mC8lq5G1 nwEMrAU5zir9IgLcMJZ+IhDjW2mqfceA0N0oYirub5DY9iQltGYJFTvTWgRlREk4MFcJ QR1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=lE9j27DvC1/srbXNmFA9deLjffoHkZ89jSlYii0k6L8=; b=O1xpSEByMyww8/zS9z1iXmoEf2aUEXlqEhJLzqPFZGDPqW4nVmYRECpx9H1TA/+qMj Fc2IRsGXBwQSsZ/+CIlg88/9wxxCeHNV6LVW0mSw6TY2kssTy6G6MLxBqWlJf+nlmO2s 3ClibR2Mzp6Ujtvjl7Ev7NsAGes02hXwF/K03ZpQaJ6RPkW2PIVuokTHlYFBT7CbcJU6 e8krbJ1mLzyDhBh0SafXEyVdFPrDxHQHlenc3DDQ3UMUsGH0vMW8muvjT5Cnh5wvHcpc smR5YEfhBPPrQM6/uNJ+UUjB7gDx5z/iCwZLin0YC944Gza2PJb8HgmO1OsvWKTRJAO9 HsDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=kJXMSba2; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 33si196822plt.228.2018.12.03.00.54.29; Mon, 03 Dec 2018 00:54:44 -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; dkim=fail header.i=@gmail.com header.s=20161025 header.b=kJXMSba2; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725921AbeLCIwk (ORCPT + 99 others); Mon, 3 Dec 2018 03:52:40 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:54474 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725845AbeLCIwk (ORCPT ); Mon, 3 Dec 2018 03:52:40 -0500 Received: by mail-wm1-f65.google.com with SMTP id z18so4817524wmc.4 for ; Mon, 03 Dec 2018 00:52:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=lE9j27DvC1/srbXNmFA9deLjffoHkZ89jSlYii0k6L8=; b=kJXMSba2ZEkLvqNWKpvQpy9ALpRwuGjt+f4X2ybrW9NpuiZUAy7zr8lk4+Ai8/IXsY diUCRl/X4GthvWGqzRKlJfnWzAnpGPpj1KIw6REzy7irT6ZRZVs7JkUsWd5OWmBm2QNH shoElaRl0w1Vk4a4GDRXqIO3ilSsHkcQLITIaB1mQDSCzsqbqJX4CRDplcagMHcB5aix wdsdc2GVeOta8mXdNMyTeInucet4pK8k2VvlAz4pelLlLtUAqd1cXZpbTIhbGRViBSmq Jji0I6iI9+nV/rbY9m6sHRv9OHpGk2slF7tz6lV92zt82OJ624oHh/yOFDBr+fdE8Zbq JIaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=lE9j27DvC1/srbXNmFA9deLjffoHkZ89jSlYii0k6L8=; b=bSH/u4J8KZE0OLbPNJwv0XRwFq7F8LcvCsPyKnPgHetX6xv/8oETxS50mVkMf3diH2 paQ+AGV4+0AwwdNEmKQB32hAqPjuSnD1EkXrgGUkjXq3+6eWxuqTO+fcIg66vbnXJMzU X63GzCqweNxT9KfgJlCqOv9WHS7Kbju6v1/jukEBjo1+i+wtkh/Kex/UEabBRyO12OF5 f16COVgCyBiqDI633ON3kMtTIJDVHTJI2DV+Tu4QWQan3VWbmXFe8JUme7H8V4rVIvEm XGSAt3s9yeMpD5DhbpP2Q3YahmG4If+288lFpkiwm0s2LuHBOpFj75vexaZm9GvZzgzd w3Og== X-Gm-Message-State: AA+aEWaF5FyHGuYqpm8wusko5sTdr9ADwbDzMP1FhUQRvH9dZcYTbBSc 2yb0/dtD7F2JjzM3JDX+t4c= X-Received: by 2002:a1c:cbc7:: with SMTP id b190mr7899854wmg.13.1543827152787; Mon, 03 Dec 2018 00:52:32 -0800 (PST) Received: from gmail.com (2E8B0CD5.catv.pool.telekom.hu. [46.139.12.213]) by smtp.gmail.com with ESMTPSA id s202sm5985603wme.40.2018.12.03.00.52.31 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Dec 2018 00:52:32 -0800 (PST) Date: Mon, 3 Dec 2018 09:52:30 +0100 From: Ingo Molnar To: Peter Zijlstra Cc: "Paul E. McKenney" , Wen Yang , Davidlohr Bueso , Josh Triplett , linux-kernel@vger.kernel.org, zhong.weidong@zte.com.cn, mingo@redhat.com, will.deacon@arm.com Subject: Re: [PATCH] locktorture: Fix assignment of boolean variables Message-ID: <20181203085230.GB2516@gmail.com> References: <20181201083149.36972-1-wen.yang99@zte.com.cn> <20181201203700.GW4170@linux.ibm.com> <20181203083500.GH11614@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181203083500.GH11614@hirez.programming.kicks-ass.net> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Peter Zijlstra wrote: > On Sat, Dec 01, 2018 at 12:37:01PM -0800, Paul E. McKenney wrote: > > On Sat, Dec 01, 2018 at 04:31:49PM +0800, Wen Yang wrote: > > > Fix the following warnings reported by coccinelle: > > > > > > kernel/locking/locktorture.c:703:6-10: WARNING: Assignment of bool to 0/1 > > > kernel/locking/locktorture.c:918:2-20: WARNING: Assignment of bool to 0/1 > > > kernel/locking/locktorture.c:949:3-20: WARNING: Assignment of bool to 0/1 > > > kernel/locking/locktorture.c:682:2-19: WARNING: Assignment of bool to 0/1 > > > kernel/locking/locktorture.c:688:2-19: WARNING: Assignment of bool to 0/1 > > > kernel/locking/locktorture.c:648:2-20: WARNING: Assignment of bool to 0/1 > > > kernel/locking/locktorture.c:654:2-20: WARNING: Assignment of bool to 0/1 > > > > > > This patch also makes the code more readable. > > > > > > Signed-off-by: Wen Yang > > > CC: Davidlohr Bueso > > > CC: "Paul E. McKenney" > > > CC: Josh Triplett > > > CC: linux-kernel@vger.kernel.org > > > > Adding the current maintainers on CC. > > So I strongly disagree with this. Anybody that has trouble with 0/1 vs > false/true needs to stay the heck away from C. Indeed, and it's actually *worse* to read, as 0/1 stands out more and is more compact than false/true... The only reasonable case where bool is recommended is when functions are returning it, to make sure there's no mishap returning something else. But for a plain .c variable? Nope. > I would suggest we delete that stupid coccinelle scripts that generates > these pointless warns. Ack. Thanks, Ingo