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]
Message-ID: <20121129220811.GA32514@ennui.austin.ibm.com>
Date:	Thu, 29 Nov 2012 16:08:11 -0600
From:	Kent Yoder <key@...ux.vnet.ibm.com>
To:	Joe Perches <joe@...ches.com>
Cc:	Peter Huewe <peterhuewe@....de>, Rajiv Andrade <mail@...jiv.net>,
	Marcel Selhorst <tpmdd@...horst.net>,
	Sirrix AG <tpmdd@...rix.com>,
	tpmdd-devel@...ts.sourceforge.net, linux-kernel@...r.kernel.org,
	Al Viro <viro@...iv.linux.org.uk>
Subject: Re: [PATCH v3] char/tpm: Use true and false for bools

On Thu, Nov 29, 2012 at 01:54:52PM -0800, Joe Perches wrote:
> On Thu, 2012-11-29 at 22:08 +0100, Peter Huewe wrote:
> > Bool initializations should use true and false.  Bool tests don't need
> > comparisons
> []
> > .v3 for this tiny patch... shame on me.
> 
> Don't be silly...
> 
> > diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
> []
> > @@ -545,7 +545,7 @@ static int tpm_tis_init(struct device *dev, resource_size_t start,
> >  			rc = -ENODEV;
> >  			goto out_err;
> >  		}
> > -		itpm = (probe == 0) ? 0 : 1;
> > +		itpm = !!probe;
> 
> Even more trivia:
> 
> This !! isn't necessary as ints assigned to bool are converted
> by the compiler to 0 or 1.

  Good to know, thanks Joe!

Kent

> 
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ