lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 09 Feb 2012 15:08:38 -0800
From:	Joe Perches <joe@...ches.com>
To:	"Allan, Bruce W" <bruce.w.allan@...el.com>,
	Julia Lawall <julia.lawall@...6.fr>
Cc:	"Kirsher, Jeffrey T" <jeffrey.t.kirsher@...el.com>,
	David Miller <davem@...emloft.net>,
	"David.Laight@...LAB.COM" <David.Laight@...LAB.COM>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	linux-wireless <linux-wireless@...r.kernel.org>
Subject: RE: [PATCH net-next] drivers/net: Remove boolean comparisons to
 true/false

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

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ