Skip to content

Commit e76bb4e

Browse files
Sangwook ShinWim Van Sebroeck
authored andcommitted
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 <[email protected]> Reviewed-by: Alim Akhtar <[email protected]> Signed-off-by: Sangwook Shin <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Signed-off-by: Guenter Roeck <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]>
1 parent 73ea1e9 commit e76bb4e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/watchdog/s3c2410_wdt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ static int s3c2410wdt_set_heartbeat(struct watchdog_device *wdd,
587587
if (count >= 0x10000) {
588588
divisor = DIV_ROUND_UP(count, 0xffff);
589589

590-
if (divisor > 0x100) {
590+
if (divisor > S3C2410_WTCON_PRESCALE_MAX + 1) {
591591
dev_err(wdt->dev, "timeout %d too big\n", timeout);
592592
return -EINVAL;
593593
}

0 commit comments

Comments
 (0)