lkml.org 
[lkml]   [2008]   [Mar]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] saa7146: fix sparse warnings
From
Date
On Sun, 2008-03-02 at 20:34 +0300, Dmitri Vorobiev wrote:
> Harvey Harrison пишет:
> >
> > - if( 0 != (dev->ext)) {
> > + if( NULL != (dev->ext)) {
>
> At the risk of looking an idiot, I'm taking a liberty to ask what is
> the point in explicit comparison to zero in conditional operators? Is
> it not a fundamental C idiom to write

<snip>

Yes, that's how I would have written it, but I tried to keep with the
prevailing style in that file. I suppose I could see an argument for
consistency if you had a long series of if() statements to keep a
similar style.

if (foo == value1)

if (bar == value2)

if (baz == NULL)

I'll leave the discussion of putting the constant first in the comparison
for someone else to comment on.

Harvey

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

\
 
 \ /
  Last update: 2008-03-02 19:09    [W:0.152 / U:0.156 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site