Skip to content
Commit 8c86fb68 authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Andrew Morton
Browse files

mul_u64_u64_div_u64: increase precision by conditionally swapping a and b

As indicated in the added comment, the algorithm works better if b is big.
As multiplication is commutative, a and b can be swapped.  Do this if a
is bigger than b.

Link: https://lkml.kernel.org/r/20240303092408.662449-2-u.kleine-koenig@pengutronix.de


Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Tested-by: default avatarBiju Das <biju.das.jz@bp.renesas.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 4bb7be96
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment