summaryrefslogtreecommitdiff
path: root/drivers/clocksource/timer-tegra186.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2025-06-20 14:19:35 +0300
committerDaniel Lezcano <daniel.lezcano@linaro.org>2025-09-23 11:55:12 +0300
commit409f8fe03e08f92bf5be96cedbcd7a3e8fb2eeaf (patch)
tree6e2860044c888adf04ab9eee76c89b4ea98bcac3 /drivers/clocksource/timer-tegra186.c
parent7f3abae5b447a7f8458a0f58a003c11c46aade99 (diff)
downloadlinux-409f8fe03e08f92bf5be96cedbcd7a3e8fb2eeaf.tar.xz
clocksource/drivers/tegra186: Avoid 64-bit division
The newly added function causes a build failure on 32-bit targets with older compiler version such as gcc-10: arm-linux-gnueabi-ld: drivers/clocksource/timer-tegra186.o: in function `tegra186_wdt_get_timeleft': timer-tegra186.c:(.text+0x3c2): undefined reference to `__aeabi_uldivmod' The calculation can trivially be changed to avoid the division entirely, as USEC_PER_SEC is a multiple of 5. Change both such calculation for consistency, even though gcc apparently managed to optimize the other one properly already. [dlezcano : Fixed conflict with 20250614175556.922159-2-linux@roeck-us.net ] Fixes: 28c842c8b0f5 ("clocksource/drivers/timer-tegra186: Add WDIOC_GETTIMELEFT support") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20250620111939.3395525-1-arnd@kernel.org
Diffstat (limited to 'drivers/clocksource/timer-tegra186.c')
-rw-r--r--drivers/clocksource/timer-tegra186.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/clocksource/timer-tegra186.c b/drivers/clocksource/timer-tegra186.c
index d403a3fe25e7..1ec7b38ff8c6 100644
--- a/drivers/clocksource/timer-tegra186.c
+++ b/drivers/clocksource/timer-tegra186.c
@@ -159,7 +159,7 @@ static void tegra186_wdt_enable(struct tegra186_wdt *wdt)
tmr_writel(wdt->tmr, TMRCSSR_SRC_USEC, TMRCSSR);
/* configure timer (system reset happens on the fifth expiration) */
- value = TMRCR_PTV(wdt->base.timeout * USEC_PER_SEC / 5) |
+ value = TMRCR_PTV(wdt->base.timeout * (USEC_PER_SEC / 5)) |
TMRCR_PERIODIC | TMRCR_ENABLE;
tmr_writel(wdt->tmr, value, TMRCR);