Subject: Re: [PATCH v2] e1000e: Assign true and false to bool type variable instead of 1 and 0

From: Al Viro <[email-masked]>
Date: Wed, 7 Dec 2011 07:20:50 +0000

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?