Re: [PATCH] Kill div64.h dupes, parenthesize do_div() macro params

From: Andrea Arcangeli (andrea@suse.de)
Date: Wed Jul 02 2003 - 00:57:59 EST


On Wed, Jul 02, 2003 at 01:36:03PM +1000, Peter Chubb wrote:
> Platforms that never expect to deal with a 64-bit number just redefine
> the macro in terms of long. Which means that printing out long longs

this doesn't even sounds safe. If it's just for printing not a big deal,
but there may be functional usages where they should not truncate the
high 32bit of the 64bit words.

Bernardo, you should definitely add an #if BITS_PER_LONG == 64 around
your implementation of do_div in asm-generic, just to make an example
sparc is still silenty broken (and that's not an embedded thing).

In the #else path of the generic implementation you can consider adding
another version that casts to (long long), then as worse it will spwan a
link compile time failure. But if it compiles it won't generate runtime
failures. so basically it's up to gcc to do the right thing then.

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



This archive was generated by hypermail 2b29 : Mon Jul 07 2003 - 22:00:15 EST