]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
watchdog: s3c2410_wdt: Fix max_timeout being calculated larger
authorSangwook Shin <sw617.shin@samsung.com>
Mon, 18 Aug 2025 02:18:23 +0000 (11:18 +0900)
committerWim Van Sebroeck <wim@linux-watchdog.org>
Fri, 12 Sep 2025 16:06:32 +0000 (18:06 +0200)
commitdf3c6e0b6d83450563d6266e1dacc7eaf25511f4
tree92587791ff374eb5dce3099f427654b512f3be55
parente76bb4ee92dc6b4f21eb13d79b5c190b2e5a97e5
watchdog: s3c2410_wdt: Fix max_timeout being calculated larger

Fix the issue of max_timeout being calculated larger than actual value.
The calculation result of freq / (S3C2410_WTCON_PRESCALE_MAX + 1) /
S3C2410_WTCON_MAXDIV is smaller than the actual value because the remainder
is discarded during the calculation process. This leads to a larger
calculated value for max_timeout compared to the actual settable value.
To resolve this issue, the order of calculations in the computation process
has been adjusted.

Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org>
Signed-off-by: Sangwook Shin <sw617.shin@samsung.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
drivers/watchdog/s3c2410_wdt.c