]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
ethernet: renesas: Use div64_ul instead of do_div
authorYang Li <yang.lee@linux.alibaba.com>
Thu, 18 Nov 2021 09:48:03 +0000 (17:48 +0800)
committerPaolo Pisati <paolo.pisati@canonical.com>
Fri, 28 Jan 2022 10:02:27 +0000 (11:02 +0100)
commit9a4732b81943cc0ef39021d0e1362e99a709a5ee
treed6046294b78dca31c0ec63d0ff0740fce1391264
parent1557a8b3dbcbc9ef03ae748ac176e2307958efd7
ethernet: renesas: Use div64_ul instead of do_div

BugLink: https://bugs.launchpad.net/bugs/1959376
[ Upstream commit d9f31aeaa1e5aefa68130878af3c3513d41c1e2d ]

do_div() does a 64-by-32 division. Here the divisor is an
unsigned long which on some platforms is 64 bit wide. So use
div64_ul instead of do_div to avoid a possible truncation.

Eliminate the following coccicheck warning:
./drivers/net/ethernet/renesas/ravb_main.c:2492:1-7: WARNING:
do_div() does a 64-by-32 division, please consider using div64_ul
instead.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Link: https://lore.kernel.org/r/1637228883-100100-1-git-send-email-yang.lee@linux.alibaba.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
drivers/net/ethernet/renesas/ravb_main.c