From: Julia Lawall <julia.lawall@lip6.fr>
To: Joe Perches <joe@perches.com>
Cc: "Allan, Bruce W" <bruce.w.allan@intel.com>,
Julia Lawall <julia.lawall@lip6.fr>,
"Kirsher, Jeffrey T" <jeffrey.t.kirsher@intel.com>,
David Miller <davem@davemloft.net>,
"David.Laight@ACULAB.COM" <David.Laight@ACULAB.COM>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
linux-wireless <linux-wireless@vger.kernel.org>
Subject: RE: [PATCH net-next] drivers/net: Remove boolean comparisons to true/false
Date: Fri, 10 Feb 2012 07:46:01 +0100 (CET) [thread overview]
Message-ID: <alpine.DEB.2.02.1202100745050.1981@hadrien> (raw)
In-Reply-To: <1328828918.29329.21.camel@joe2Laptop>
On Thu, 9 Feb 2012, Joe Perches wrote:
> On Thu, 2012-02-09 at 22:36 +0000, Allan, Bruce W wrote:
>>> On Thu, 2012-02-09 at 13:17 -0800, Joe Perches wrote:
>>>> Booleans should not be compared to true or false
>>>> but be directly tested or tested with !.
>>>>
>>>> Done via cocci script:
>>>>
>>>> @@
>>>> bool t;
>>>> @@
>>>> - t == true
>>>> + t
>>>> @@
>>>> bool t;
>>>> @@
>>>> - t != true
>>>> + !t
>>>> @@
>>>> bool t;
>>>> @@
>>>> - t == false
>>>> + !t
>>>> @@
>>>> bool t;
>>>> @@
>>>> - t != false
>>>> + t
>
>> Has the cocci script been (or will it be) added to ./scripts/coccinelle?
>
> These are pretty trivial scripts.
>
> You're welcome to add it or combine it
> with the one Rusty did to convert
> bool foo = 1
> to
> bool foo = true
>
> https://lkml.org/lkml/2011/12/19/15
It would indeed seem nice to put them all together. I can do that.
julia
next prev parent reply other threads:[~2012-02-10 6:46 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-09 10:27 [net-next 0/7][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
2012-02-09 10:27 ` [net-next 1/7] e1000e: remove test that is always false Jeff Kirsher
2012-02-09 10:27 ` [net-next 2/7] e1000e: remove unnecessary returns from void functions Jeff Kirsher
2012-02-09 10:27 ` [net-next 3/7] e1000e: remove unnecessary parentheses Jeff Kirsher
2012-02-09 10:27 ` [net-next 4/7] e1000e: use true/false for bool autoneg_false Jeff Kirsher
2012-02-09 13:15 ` David Laight
2012-02-09 18:34 ` David Miller
[not found] ` <20120209.133413.349832435589531136.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2012-02-09 21:17 ` [PATCH net-next] drivers/net: Remove boolean comparisons to true/false Joe Perches
2012-02-09 21:28 ` Jeff Kirsher
2012-02-09 22:36 ` Allan, Bruce W
2012-02-09 23:08 ` Joe Perches
2012-02-10 6:46 ` Julia Lawall [this message]
2012-02-10 9:32 ` David Laight
2012-02-10 9:50 ` Arend van Spriel
[not found] ` <AE90C24D6B3A694183C094C60CF0A2F6026B6E65-CgBM+Bx2aUAnGFn1LkZF6NBPR1lH4CV8@public.gmane.org>
2012-02-10 13:04 ` Eric Dumazet
2012-02-13 5:50 ` David Miller
2012-02-09 10:28 ` [net-next 6/7] e1000e: replace '1' with 'true' for boolean get_link_status Jeff Kirsher
2012-02-09 10:28 ` [net-next 7/7] igb: fix warning about unused function Jeff Kirsher
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=alpine.DEB.2.02.1202100745050.1981@hadrien \
--to=julia.lawall@lip6.fr \
--cc=David.Laight@ACULAB.COM \
--cc=bruce.w.allan@intel.com \
--cc=davem@davemloft.net \
--cc=jeffrey.t.kirsher@intel.com \
--cc=joe@perches.com \
--cc=linux-wireless@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/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