Commit e76bb4ee authored by Sangwook Shin's avatar Sangwook Shin Committed by Wim Van Sebroeck
Browse files

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: default avatarSam Protsenko <semen.protsenko@linaro.org>
Reviewed-by: default avatarAlim Akhtar <alim.akhtar@samsung.com>
Signed-off-by: default avatarSangwook Shin <sw617.shin@samsung.com>
Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarWim Van Sebroeck <wim@linux-watchdog.org>
parent 73ea1e92
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
		}