Re: arca-1-against-pre-2.1.127-3

Linus Torvalds (torvalds@transmeta.com)
31 Oct 1998 18:34:53 GMT


In article <Pine.LNX.4.02A.9810311434520.242-100000@mikeg.weiden.de>,
Mike Galbraith <mikeg@weiden.de> wrote:
>
>--- include/linux/timer.h.org Sat Oct 31 09:08:31 1998
>+++ include/linux/timer.h Sat Oct 31 09:38:17 1998
>@@ -99,4 +99,8 @@
> return((long)((a) - (b)) >= 0L);
> }
>
>+extern inline unsigned long time_delta(unsigned long now, unsigned long then)
>+{
>+ return now < then ? ~then + now + 1 : now - then;
>+}
> #endif

One of us must be on drugs. As far as I can tell, the above is
equivalent to unconditionally doing

"now - then"

except your version is much stranger.

Correct me if I'm wrong, but (~then+1) == -then in two's complement (and
nothing else matters), so (~then+now+1) is the same as (now-then).

Linus

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