Re: [PATCH] Silent compiler warning introduced byacea6852f32b8805e166d885ed7e9f0c7cd10d41 ([BLUETOOTH]: Move children ofconnection device to NULL before connection down.)

From: Linus Torvalds
Date: Sun Feb 10 2008 - 13:59:45 EST




On Sun, 10 Feb 2008, S.ÃaÄlar Onur wrote:
> > >
> > > - while (dev = device_find_child(&conn->dev, NULL, __match_tty)) {
> > > + while ((dev = device_find_child(&conn->dev, NULL, __match_tty)) != NULL) {
> > >
> > Why do you need '!= NULL'?
>
> I thought its more readable than
>
> while ((dev = device_find_child(&conn->dev, NULL, __match_tty))) {

Yes indeed. I hate the idiotic "double parenthesis without any meaning".
I'd much rather see "((..) != NULL)" than "((..))", because the latter is
totally meaningless semantically (although gcc gives it semantics).

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