Thread (8 messages) flat view 8 messages, 8 authors, 2012-02-13

RE: [PATCH net-next] drivers/net: Remove boolean comparisons to true/false

From: Joe Perches <joe@perches.com>
Date: 2012-02-09 23:08:40
Also in: linux-wireless

Possibly related (same subject, not in this thread)

On Thu, 2012-02-09 at 22:36 +0000, Allan, Bruce W wrote:
quoted
On Thu, 2012-02-09 at 13:17 -0800, Joe Perches wrote:
quoted
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help