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] [day] [month] [year] [list]
Date:	Sat, 26 Jan 2008 23:00:00 -0800 (PST)
From:	Linus Torvalds <torvalds@...ux-foundation.org>
To:	Michael K?hn <breiteseite1337@...glemail.com>
cc:	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/1] 2.6.24, net/bluetooth/hci_sysfs.c, cleaned code
 remove compiler warning



On Sun, 27 Jan 2008, Michael K?hn wrote:
> 
> the attached Patch will remove a compiler warning in
> net/bluetooth/hci_sysfs.c:

Please don't do this. I realize that gcc suggests just adding parenthesis, 
and yes, it makes the warning go away, but it's not sensible from a human 
semantic standpoint.

So if the warning bothers you, please change

	while (dev = device_find_child(..)) {

into something like

	while ((dev = device_find_child(..)) != NULL) {

which also gets rid of the warning, but now does it with something that 
makes sense to a human too.

Just arbitrarily adding another set of parentheses never made much sense 
to me. It's semantically still the exact same expression, just the fact 
that gcc suddenly doesn't warn about the assignment because it's "hidden" 
by the extra parenthesis is just odd.

		Linus
--
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