Skip to contentSkip to conversation

watchdog: f71808e_wdt: Fix WD_EN register read

PATCH In review Igor Pylypiv 2 participants 2 messages Mar 7, 2018 Watchdog device drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 watchdog: f71808e_wdt: Fix WD_EN register read

F71808FG_FLAG_WD_EN defines bit position, not a bitmask

---
 drivers/watchdog/f71808e_wdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/watchdog/f71808e_wdt.c +1 -1
index 3a33c53..9a1c761 100644
@@ -496,7 +496,7 @@ static bool watchdog_is_running(void)
 
 	is_running = (superio_inb(watchdog.sioaddr, SIO_REG_ENABLE) & BIT(0))
 		&& (superio_inb(watchdog.sioaddr, F71808FG_REG_WDT_CONF)
-			& F71808FG_FLAG_WD_EN);
+			& BIT(F71808FG_FLAG_WD_EN));
 
 	superio_exit(watchdog.sioaddr);
 
Signature · 1 line
2.7.4
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · Igor Pylypiv

F71808FG_FLAG_WD_EN defines bit position, not a bitmask

Good catch. Wim - candidate for v4.16-rc and stable.

Quoted 18 lines
---
  drivers/watchdog/f71808e_wdt.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/watchdog/f71808e_wdt.c +1 -1
index 3a33c53..9a1c761 100644
@@ -496,7 +496,7 @@ static bool watchdog_is_running(void)
 
  	is_running = (superio_inb(watchdog.sioaddr, SIO_REG_ENABLE) & BIT(0))
  		&& (superio_inb(watchdog.sioaddr, F71808FG_REG_WDT_CONF)
-			& F71808FG_FLAG_WD_EN);
+			& BIT(F71808FG_FLAG_WD_EN));
 
  	superio_exit(watchdog.sioaddr);