lkml.org 
[lkml]   [2005]   [Aug]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] spi
On Mon, Aug 08, 2005 at 07:35:36PM +0200, Marcel Holtmann wrote:
> > > + if (NULL == dev || NULL == driver) {
> >
> > Put the variable on the left side, gcc will complain if you incorrectly
> > put a "=" instead of a "==" here, which is all that you are defending
> > against with this style.
>
> I think in this case the preferred way is
>
> if (!dev || !driver) {
>

That's not a guaranteed equivalence in the C standard. Null pointers
may not be zero. I don't think we have any targets that work this
way, however there is nothing wrong with explicitly testing for NULL.
-
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: 2005-08-08 19:49    [W:0.056 / U:0.428 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site