Message ID | 20250514094220.1561378-3-sw617.shin@samsung.com |
---|---|
State | New |
Headers | show |
Series | [v2,1/5] watchdog: s3c2410_wdt: Replace hardcoded values with macro definitions | expand |
diff --git a/drivers/watchdog/s3c2410_wdt.c b/drivers/watchdog/s3c2410_wdt.c index 228f86d83663..c6166d927155 100644 --- a/drivers/watchdog/s3c2410_wdt.c +++ b/drivers/watchdog/s3c2410_wdt.c @@ -379,8 +379,8 @@ static inline unsigned int s3c2410wdt_max_timeout(struct s3c2410_wdt *wdt) { const unsigned long freq = s3c2410wdt_get_freq(wdt); - return S3C2410_WTCNT_MAXCNT / (freq / (S3C2410_WTCON_PRESCALE_MAX + 1) - / S3C2410_WTCON_MAXDIV); + return S3C2410_WTCNT_MAXCNT / DIV_ROUND_UP(freq, + (S3C2410_WTCON_PRESCALE_MAX + 1) * S3C2410_WTCON_MAXDIV); } static int s3c2410wdt_disable_wdt_reset(struct s3c2410_wdt *wdt, bool mask)