Re: [patch] time_after_eq fix

From: Chris Friesen
Date: Wed May 18 2005 - 18:17:06 EST


Coywolf Qi Hunt wrote:
Hello,

The two macros time_after and time_after_eq were added to do wrapping
correctly, but only time_after does it the right way, time_after_eq has
been wrong since the very beginning(v2.1.127, 07-Nov-1998).

- ((long)(a) - (long)(b) >= 0))
+ ((long)(b) - (long)(a) <= 0))

Why does it matter which way you do it? In what circumstances does your code give a different answer?


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