Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6787907imu; Mon, 3 Dec 2018 02:51:51 -0800 (PST) X-Google-Smtp-Source: AFSGD/UpAY0IeT3H5BNV0TUNy7PBgHyMgCvfXOQIF1GvvH6fuRUReOMUFzECj3OKsz0eKwLFA6K9 X-Received: by 2002:a63:396:: with SMTP id 144mr13011620pgd.68.1543834310952; Mon, 03 Dec 2018 02:51:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543834310; cv=none; d=google.com; s=arc-20160816; b=R1cIBJ/Io/MV5IyoyohZsSrKlbjtbke4gwcLB/KxmX26hgAT4PA0XdB/3EEIHH8MIl wkCo3eF3HXLynl/0edaBo/p0X1V7xqc14vl8c54QdV/z0+oms0zmvvQKcVDDgPVb4UQn G0BGmlhtHaYvsHWsrJmmZv8OtHQPYl/vUriduwqdKTeb5R5oVIX5rxBzjCsdRDO8sf5j nsctUmggHu/bwtAl4mSsNQONizZWp9M7lgLyb6W13udZUiabaPftLNMh/8OrXnFKfRlH r2XLa003t8kPb/k8PuR5ga7IyGb7h1N7SfYMAmooPcrnxh6cuozKbwwT0Ufhu51sMa99 kA4A== 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=ZRqrzvaSqYPlyr/uF2HAY3yYSZv0lA7oKs8FpC0BNJ0=; b=Gi6QV/A8ejJZA/cCoNvEeP1UnxBo9vWtgUw+Zxcn/8EEyv60DePJI0eKrBpdmKosu5 1gmCSmjO7b7XZrgRIMR9MGpTuy7IVjLZR3IIGA/NGYz/WIlVxBEISoD0hVYAikqEqKOr R764E79gYFfihZz7PfOCJ0NbV3alxj4LECDCN9I/QPGB1QMoNx/NmnFl3sWafSnmf2mN F3b+thK/PxuJGAl51xGnp9bDptfxKpH4g3sfNQWfF2HBMIyTTTlbY8p9FnPZn8xw+jn8 rxslAM27LQjtoL1O8z1JZlJMK0xv+Ut9yTNL4CkX8A7MFpVHS0BeYN3NXe2jKhVI4gA5 fRBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=3dCdXxBi; 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 d10si2674261pla.222.2018.12.03.02.51.36; Mon, 03 Dec 2018 02:51:50 -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=@infradead.org header.s=merlin.20170209 header.b=3dCdXxBi; 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 S1726222AbeLCKvc (ORCPT + 99 others); Mon, 3 Dec 2018 05:51:32 -0500 Received: from merlin.infradead.org ([205.233.59.134]:33226 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725907AbeLCKvc (ORCPT ); Mon, 3 Dec 2018 05:51:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=ZRqrzvaSqYPlyr/uF2HAY3yYSZv0lA7oKs8FpC0BNJ0=; b=3dCdXxBi2q65zAlzMuVglLaM0 en6s3VvIzRZb0APZliQG7G18klmVMN35UzzhVRN6MPrezN1DHlh3vMsR4EDYt1ECSw6nG3gKFJAJj n0w6jjXEUWhXyLfPXznxRVU49cZVSmvxhVbwYFr5YSIsdyFp6h9Q3r9h1j0VfgjVzBSoUDR0TIeWv ZidPJ6h97bS5Jg6SGJWg2KJa4/f2/ljDxmZcFnQTOE/ILn19k3oMLdVhUQJByhc3j2bS/FM8WTXuF lsJHgy4tBAbAerTtC+xAPXJEPFFIN6aeXTA6j5wUaZ9JiZ2iF2xmFo8oe3guyyVu1CvxeglSphQS7 i9x9ZZsjw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1gTloM-0006wS-Kw; Mon, 03 Dec 2018 10:50:46 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 26E722029F87F; Mon, 3 Dec 2018 11:50:45 +0100 (CET) Date: Mon, 3 Dec 2018 11:50:45 +0100 From: Peter Zijlstra To: Julia Lawall 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: <20181203105045.GD11573@hirez.programming.kicks-ass.net> References: <20181201083149.36972-1-wen.yang99@zte.com.cn> <20181201203700.GW4170@linux.ibm.com> <20181203083500.GH11614@hirez.programming.kicks-ass.net> <20181203084605.GC11650@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 03, 2018 at 10:20:42AM +0100, Julia Lawall wrote: > Personally, I would prefer that assignments involving boolean variables > use true or false. It seems more readable. Potentially better for tools > as well. Then those tools are broken per the C spec. > But if the community really prefers 0 and 1, then the test can > be deleted. The C language spec, specifies _Bool as an integer type wide enough to at least store 0 and 1. IOW, 0 and 1 are perfectly valid valus to assign to a _Bool. And fundamentally that has to be so. That's how computers work. 0 is false, 1 is true. The kernel is not the place to try and abstract such stuff, C is our portable assembler. We muck with hardware, we'd better know how the heck it works.