Re: [PATCH] net: ethernet: cavium: use div64_u64() instead of do_div()
From: Christophe JAILLET
Date: Wed Feb 09 2022 - 15:02:08 EST
Le 09/02/2022 à 14:30, patchwork-bot+netdevbpf@xxxxxxxxxx a écrit :
Hello:
This patch was applied to netdev/net-next.git (master)
by David S. Miller <davem@xxxxxxxxxxxxx>:
On Wed, 9 Feb 2022 00:39:19 -0800 you wrote:
From: Wang Qing <wangqing@xxxxxxxx>
do_div() does a 64-by-32 division.
When the divisor is u64, do_div() truncates it to 32 bits, this means it
can test non-zero and be truncated to zero for division.
fix do_div.cocci warning:
do_div() does a 64-by-32 division, please consider using div64_u64 instead.
[...]
Here is the summary with links:
- net: ethernet: cavium: use div64_u64() instead of do_div()
https://git.kernel.org/netdev/net-next/c/038fcdaf0470
You are awesome, thank you!
Hi,
I think that this patch should be reverted because do_div() and
div64_u64() don't have the same calling convention.
See [1]
[1]:
https://lore.kernel.org/linux-kernel/20211117112559.jix3hmx7uwqmuryg@xxxxxxxxxxxxxx/
CJ