[PATCH] watchdog: xilinx_wwdt: Use div_u64() in xilinx_wwdt_start()
Rob Herring
robh at kernel.org
Wed Aug 23 08:18:51 PDT 2023
On Tue, Aug 15, 2023 at 12:06:50PM -0700, Nathan Chancellor wrote:
> After commit f1a43aadb5a6 ("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: Nathan Chancellor <nathan at kernel.org>
> ---
> drivers/watchdog/xilinx_wwdt.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
Thanks for the fix. Also reported by 0-day with a similar failure:
All errors (new ones prefixed by >>):
microblaze-linux-ld: drivers/watchdog/xilinx_wwdt.o: in function `xilinx_wwdt_start':
>> drivers/watchdog/xilinx_wwdt.c:74: undefined reference to `__udivdi3'
Acked-by: Rob Herring <robh at kernel.org>
More information about the linux-arm-kernel
mailing list