Skip to contentSkip to conversation

watchdong: kempld_wdt: fix bit mask definition

PATCH In review Jingoo Han 2 participants 2 messages Aug 1, 2013 – Aug 2, 2013 Watchdog device drivers

lore
Share & tools
lore

Jingoo Han

author
#0 lore raw

PATCH 2/2 watchdong: kempld_wdt: fix bit mask definition

STAGE_CFG bits are defined as [5:4] bits. However, '(((x) & 0x30) << 4)' handles [9:8] bits. Thus, it should be fixed in order to handle [5:4] bits.

---
 drivers/watchdog/kempld_wdt.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/watchdog/kempld_wdt.c +1 -1
index d204258..8a8e3ec 100644
@@ -35,7 +35,7 @@
 #define KEMPLD_WDT_STAGE_TIMEOUT(x)	(0x1b + (x) * 4)
 #define KEMPLD_WDT_STAGE_CFG(x)		(0x18 + (x))
 #define STAGE_CFG_GET_PRESCALER(x)	(((x) & 0x30) >> 4)
-#define STAGE_CFG_SET_PRESCALER(x)	(((x) & 0x30) << 4)
+#define STAGE_CFG_SET_PRESCALER(x)	(((x) & 0x3) << 4)
 #define STAGE_CFG_PRESCALER_MASK	0x30
 #define STAGE_CFG_ACTION_MASK		0x7
 #define STAGE_CFG_ASSERT		(1 << 3)
Signature · 1 line
1.7.10.4