> > #define IS_TIMED_OUT(timeout) (jiffies>timeout) || \
> > (timeout-jiffies>MAX_JIFFIES/2)
> start = jiffies;
> while (jiffies - start < delay) continue;
>
> solves the problem, and is much faster.
I was thinking of MAX_JIFFIES as an arbitary number, thus the "a
wraparound every 5 minutes" could be done by redefining MAX_JIFFIES. But
yes, this isnt worth it.
Anyways, using a macro would be better IMHO, because "good" code would
be easy to separate from "broken" code.
-- mingo