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:	Wed, 7 Dec 2011 07:20:50 +0000
From:	Al Viro <viro@...IV.linux.org.uk>
To:	Michael Wang <wangyun@...ux.vnet.ibm.com>
Cc:	Joe Perches <joe@...ches.com>, jeffrey.t.kirsher@...el.com,
	"e1000-devel@...ts.sourceforge.net" 
	<e1000-devel@...ts.sourceforge.net>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	"wangyunlinux@...il.com" <wangyunlinux@...il.com>,
	"Brandeburg, Jesse" <jesse.brandeburg@...el.com>
Subject: Re: [PATCH v2] e1000e: Assign true and false to bool type variable
 instead of 1 and 0

On Wed, Dec 07, 2011 at 02:36:20PM +0800, Michael Wang wrote:
> On 12/07/2011 02:19 PM, Joe Perches wrote:

[snip]
> >  	if (*i2cctl & IXGBE_I2C_DATA_IN)
> > -		data = 1;
> > +		data = true;
> >  	else
> > -		data = 0;
> > +		data = false;
> > 
> >  	return data;

Yuck...

bool f(whatever)
{
	bool data;
	if (expression)
		data = true;
	else
		data = false;
	return data;
}

is amazingly unidiomatic.  Hell, if nothing else it's
	bool data = expression;
	return data;
if not an outright
	return expression;
or
	return (bool)expression;
if you want to underline that it's treated as boolean...  What tool
has produced that patch?
--
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