From: Mikael Pettersson <mikpe@csd.uu.se>
To: Corey Minyard <minyard@acm.org>
Cc: Mikael Pettersson <mikpe@csd.uu.se>, lkml <linux-kernel@vger.kernel.org>
Subject: Re: Patch to 2.6.8.1-mm2 to allow multiple NMI handlers to be registered
Date: Thu, 19 Aug 2004 18:27:20 +0200 [thread overview]
Message-ID: <16676.54504.957712.269455@alkaid.it.uu.se> (raw)
In-Reply-To: <4124D25C.20703@acm.org>
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
next prev parent reply other threads:[~2004-08-19 16:27 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-19 14:35 Corey Minyard
2004-08-19 15:29 ` Mikael Pettersson
2004-08-19 16:16 ` Corey Minyard
2004-08-19 16:27 ` Mikael Pettersson [this message]
2004-08-19 16:45 ` Andreas Schwab
2004-08-19 16:31 ` John Levon
2004-08-20 22:42 ` Zwane Mwaikambo
2004-08-19 19:15 ` Corey Minyard
2004-08-19 16:40 ` Andreas Dilger
2004-08-19 19:27 ` Corey Minyard
2004-08-21 10:26 Mikael Pettersson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=16676.54504.957712.269455@alkaid.it.uu.se \
--to=mikpe@csd.uu.se \
--cc=linux-kernel@vger.kernel.org \
--cc=minyard@acm.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®