Re: [PATCH 2/4] jiffies: Add 64bit jiffies compares (needed when long < 64bit).

From: Dmitriy Zavin
Date: Wed Sep 20 2006 - 19:08:47 EST


These compares are there to use jiffies_64 safely on 32bit and 64 bit
systems, and jiffies_64 (and thus get_jiffies_64()) is always defined
as u64. Since this is not arch code, but generic for all
architectures, it should use the generic u64/s64 types. If the user
passes in a long and assumes that it's 64 bit, then it is user error.
I'll add a comment that says that these macros must be used with u64
values (as returned by get_jiffies_64()).

Thanks.

--Dima

P.S. This also means that currently, on 64 bit systems,
time_before/time_after is broken (typecheck fails) on values returned
by get_jiffies_64().

On 9/20/06, Andi Kleen <ak@xxxxxxx> wrote:

> +#define time_after64(a,b) \
> + (typecheck(__u64, a) && \
> + typecheck(__u64, b) && \

Did you double check the typecheck DTRT when someone
passes in both plain long and long long on 64bit?

-Andi


-
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/