lkml.org 
[lkml]   [1998]   [Oct]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
SubjectRe: arca-1-against-pre-2.1.127-3
Date
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/

\
 
 \ /
  Last update: 2005-03-22 13:45    [W:0.932 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site