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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <[email protected]> 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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux