Re: [PATCH 1/1] 2.6.24, net/bluetooth/hci_sysfs.c, cleaned code remove compiler warning

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Michael K?hn <breiteseite1337@...>
Cc: <linux-kernel@...>
Date: Sunday, January 27, 2008 - 3:00 am

On Sun, 27 Jan 2008, Michael K?hn wrote:

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
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH 1/1] 2.6.24, net/bluetooth/hci_sysfs.c, cleaned c..., Linus Torvalds, (Sun Jan 27, 3:00 am)