lkml.org 
[lkml]   [2004]   [Aug]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Patch to 2.6.8.1-mm2 to allow multiple NMI handlers to be registered
Corey Minyard writes:
> > > + /*
> > > + * If the timer has overflowed, this is certainly a watchdog
> > > + * source
> > > + */
> > > + source = (low & (1 << 31)) == 0;
> > > + if (source)
> >
> >Why not "if ((int)low >= 0)"?
> >
> >
> IIRC, the docs state that timer goes off if the high bit is cleared in
> the register. I was just going with the documentation description. Not
> a big deal either way, I don't think.

Which is the same as saying it occurs on the negative-to-non-negative
transition. The "if ((int)low >= 0)" test is just a test and branch
on sign, while your original requires either a (microcoded?) bit op,
or constructing a large-magnitude mask, followed by some tests.

Yes this is a micro-optimisation, but I find it actually simplifies the code.

/Mikael
-
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-03-22 14:05    [W:0.040 / U:1.248 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site