lkml.org 
[lkml]   [2009]   [Jun]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC PATCH 1/1] smi_detector: A System Management Interrupt detector
From
Date
On Tue, 2009-06-09 at 14:56 -0700, Andrew Morton wrote:
> On Tue, 09 Jun 2009 17:50:01 -0400
> Jon Masters <jonathan@jonmasters.org> wrote:
>
> > > > + if (0 != err)
> > >
> > > if (err != 0)
> > >
> > > or
> > >
> > > if (err)
> > >
> > > would be more typical.
> >
> > The former runs the risk of assignment,
>
> yup, which is why gcc will warn if you do
>
> if (err = 0)
>
> If you really meant to do that, then gcc can be silenced by
> double-parenthesising. We consider this "good enough" for kernel
> purposes, so we generally don't use the `if (CONSTANT == variable)' trick.

Ah, yes, good point.

Jon.




\
 
 \ /
  Last update: 2009-06-10 00:57    [W:0.036 / U:0.364 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site