From: Sangwook Shin Date: Mon, 18 Aug 2025 02:18:22 +0000 (+0900) Subject: watchdog: s3c2410_wdt: Replace hardcoded values with macro definitions X-Git-Tag: v6.18-rc1~59^2~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e76bb4ee92dc6b4f21eb13d79b5c190b2e5a97e5;p=thirdparty%2Flinux.git watchdog: s3c2410_wdt: Replace hardcoded values with macro definitions Modify the code to utilize macro-defined values instead of hardcoded values. The value 0x100 in the s3c2410wdt_set_heartbeat function represents S3C2410_WTCON_PRESCALE_MAX + 1, but it is hardcoded, making its meaning difficult to understand and reducing code readability. Reviewed-by: Sam Protsenko Reviewed-by: Alim Akhtar Signed-off-by: Sangwook Shin Reviewed-by: Guenter Roeck Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck --- diff --git a/drivers/watchdog/s3c2410_wdt.c b/drivers/watchdog/s3c2410_wdt.c index 40901bdac4261..95f7207e390a3 100644 --- a/drivers/watchdog/s3c2410_wdt.c +++ b/drivers/watchdog/s3c2410_wdt.c @@ -587,7 +587,7 @@ static int s3c2410wdt_set_heartbeat(struct watchdog_device *wdd, if (count >= 0x10000) { divisor = DIV_ROUND_UP(count, 0xffff); - if (divisor > 0x100) { + if (divisor > S3C2410_WTCON_PRESCALE_MAX + 1) { dev_err(wdt->dev, "timeout %d too big\n", timeout); return -EINVAL; }