public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Julia Lawall <julia.lawall@lip6.fr>
Cc: "Paul E. McKenney" <paulmck@linux.ibm.com>,
	Wen Yang <wen.yang99@zte.com.cn>,
	Davidlohr Bueso <dave@stgolabs.net>,
	Josh Triplett <josh@joshtriplett.org>,
	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
Date: Mon, 3 Dec 2018 11:50:45 +0100	[thread overview]
Message-ID: <20181203105045.GD11573@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <alpine.DEB.2.20.1812031016330.7942@hadrien>

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.



  reply	other threads:[~2018-12-03 10:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-01  8:31 [PATCH] locktorture: Fix assignment of boolean variables Wen Yang
2018-12-01 20:37 ` Paul E. McKenney
2018-12-03  8:35   ` Peter Zijlstra
2018-12-03  8:46     ` Peter Zijlstra
2018-12-03  9:20       ` Julia Lawall
2018-12-03 10:50         ` Peter Zijlstra [this message]
2018-12-03 14:07           ` Julia Lawall
2018-12-03  8:52     ` Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181203105045.GD11573@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=dave@stgolabs.net \
    --cc=josh@joshtriplett.org \
    --cc=julia.lawall@lip6.fr \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=paulmck@linux.ibm.com \
    --cc=wen.yang99@zte.com.cn \
    --cc=will.deacon@arm.com \
    --cc=zhong.weidong@zte.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox