Skip to content
Commit 98334dc2 authored by Nathan Chancellor's avatar Nathan Chancellor Committed by Wim Van Sebroeck
Browse files

watchdog: xilinx_wwdt: Use div_u64() in xilinx_wwdt_start()

After commit f1a43aad ("watchdog: Enable COMPILE_TEST for more
drivers"), it is possible to enable this driver on 32-bit architectures.
When building for those architectures with clang, there is an error due
to a 64-bit division in xilinx_wwdt_start():

  ERROR: modpost: "__aeabi_uldivmod" [drivers/watchdog/xilinx_wwdt.ko] undefined!

Use div_u64() to fix this, which takes a 64-bit dividend and 32-bit
divisor. GCC likely avoids the same error due to optimizations it
employs to transform division by a constant into other equivalent
operations, which may be different than what is implemented in clang.

Link: https://github.com/ClangBuiltLinux/linux/issues/1915


Signed-off-by: default avatarNathan Chancellor <nathan@kernel.org>
Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20230815-watchdog-xilinx-div_u64-v1-1-20b0b5a65c2e@kernel.org


Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarWim Van Sebroeck <wim@linux-watchdog.org>
parent 8b3c3662
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