Skip to content

Commit ecb9d31

Browse files
arndbgregkh
authored andcommitted
watchdog: aspeed: fix 64-bit division
commit 48a1366 upstream. On 32-bit architectures, the new calculation causes a build failure: ld.lld-21: error: undefined symbol: __aeabi_uldivmod Since neither value is ever larger than a register, cast both sides into a uintptr_t. Fixes: 5c03f9f ("watchdog: aspeed: Update bootstatus handling") Signed-off-by: Arnd Bergmann <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent c3e1091 commit ecb9d31

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/watchdog/aspeed_wdt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ static void aspeed_wdt_update_bootstatus(struct platform_device *pdev,
254254

255255
if (!of_device_is_compatible(pdev->dev.of_node, "aspeed,ast2400-wdt")) {
256256
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
257-
idx = ((intptr_t)wdt->base & 0x00000fff) / resource_size(res);
257+
idx = ((intptr_t)wdt->base & 0x00000fff) / (uintptr_t)resource_size(res);
258258
}
259259

260260
scu_base = syscon_regmap_lookup_by_compatible(scu.compatible);

0 commit comments

Comments
 (0)