Search Linux Wireless

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux