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:	Tue, 30 Sep 2014 21:35:46 -0500
From:	Timur Tabi <timur@...i.org>
To:	Scott Wood <scottwood@...escale.com>
CC:	"J. German Rivera" <German.Rivera@...escale.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Arnd Bergmann <arnd@...db.de>,
	lkml <linux-kernel@...r.kernel.org>, stuart.yoder@...escale.com,
	Kim Phillips <Kim.Phillips@...escale.com>,
	Alexander Graf <agraf@...e.de>
Subject: Re: [PATCH 3/3 v2] drivers/bus: Device driver for FSL-MC DPRC devices

Scott Wood wrote:
>>> > >+       if (num_child_objects_in_mc != 0) {
>> >
>> >Like here.  Just do "if (num_child_objects_in_mc) {"

> This seems to be a place that is testing for zero as a value rather than
> as a stand-in for NULL, so I'd argue it's better style to leave it as
> is.

But in this case, zero means "none left", so this is a perfectly valid 
use-case for omitting the !=.

strcmp() is the only time I can think of to put an explicit != 0, 
because this:

	if (!strcmp(s1, s2))

is counter-intuitive.
--
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