Re: do_div64 generic

Bernardo Innocenti
2003-07-18T03:57:13Z

Andrew Morton wrote:

>>>Ths one's OK by me. Let's just fix the bug with minimum risk and churn.
>>
>> Uh, bug? I was not aware that there was a bug. As far as I know,
>> nothing is broken.
>
> wtf? Then why are people running around brandishing big scary patches
> at me?

ROTFL! :-)

I've been asked by George to add generic support for the existing
div_long_long_rem() inline function.

The patch might be big, but not that much scary... I'm just replacing
two local redefinitions of the macro with a single inline in
asm-generic/div64.h. It's more a cleanup than a bug fix.

The patch also takes care of the few archs that wrote their own
optimized versions of do_div(). For those, I've implemented
div_long_long_rem() in terms of do_div() because it might still
be better than the generic version. I've left a FIXME there to
let the arch maintainers know that these could be better optimized.

And, as a special bonus, the patch also adds missing parentheses
around do_div() arguments in asm-arm/div64.h. This is the only real
bug being fixed.