Hi Alexey,

On 2026-07-30T18:40:37, Alexey Charkov <[email protected]> wrote:

> While auditing the header, two bugs turned up in lib/div64.c, so this
> series starts with those. Both are 32-bit only:

Thanks for looking at this!

> - div64_u64() and div64_u64_rem() shifted by 1 + fls(high) instead of
>   fls(high), losing a bit of the divisor. Linux fixed this in 2019, while
>   U-Boot never picked it up.

Since patch 1 has such a nice reproducer, how about adding a small
self-test under test/lib/ for div64_u64() and div64_s64() as part of
this series? It would guard against future regressions on 32-bit and
give the sync patches some cover. A handful of the
divisor-just-above-2^32 cases plus the div64_s64() truncation case
would be plenty.

Regards,
Simon

Reply via email to