Re: [PATCH v4 next 0/9] Implement mul_u64_u64_div_u64_roundup()
From: Oleg Nesterov
Date: Fri Oct 31 2025 - 09:54:32 EST
On 10/29, David Laight wrote:
>
> The pwm-stm32.c code wants a 'rounding up' version of mul_u64_u64_div_u64().
> This can be done simply by adding 'divisor - 1' to the 128bit product.
> Implement mul_u64_add_u64_div_u64(a, b, c, d) = (a * b + c)/d based on the
> existing code.
> Define mul_u64_u64_div_u64(a, b, d) as mul_u64_add_u64_div_u64(a, b, 0, d) and
> mul_u64_u64_div_u64_roundup(a, b, d) as mul_u64_add_u64_div_u64(a, b, d-1, d).
Sorry for the noise. Can't review due to the lack of knowledge.
But this reminds me... What about
[PATCH v3 1/2] x86/math64: handle #DE in mul_u64_u64_div_u64()
https://lore.kernel.org/all/20250815164055.GA13444@xxxxxxxxxx
?
should I resend it once again or we don't care?
Oleg.