[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1383501164-8111-2-git-send-email-b.brezillon@overkiz.com>
Date: Sun, 3 Nov 2013 18:52:42 +0100
From: Boris BREZILLON <b.brezillon@...rkiz.com>
To: Wim Van Sebroeck <wim@...ana.be>
Cc: Fabio Porcedda <fabio.porcedda@...il.com>,
Nicolas Ferre <nicolas.ferre@...el.com>,
Guenter Roeck <groeck7@...il.com>,
Yang Wenyou <wenyou.yang@...el.com>,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-watchdog@...r.kernel.org,
Boris BREZILLON <b.brezillon@...rkiz.com>
Subject: [PATCH 1/3] watchdog: at91sam9_wdt: fix secs_to_ticks
Fix the secs_to_ticks macro in case 0 is passed as an argument.
Signed-off-by: Boris BREZILLON <b.brezillon@...rkiz.com>
---
drivers/watchdog/at91sam9_wdt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/watchdog/at91sam9_wdt.c b/drivers/watchdog/at91sam9_wdt.c
index 9bd089e..65f4691 100644
--- a/drivers/watchdog/at91sam9_wdt.c
+++ b/drivers/watchdog/at91sam9_wdt.c
@@ -51,7 +51,7 @@
#define ticks_to_hz_rounddown(t) ((((t) + 1) * HZ) >> 8)
#define ticks_to_hz_roundup(t) (((((t) + 1) * HZ) + 255) >> 8)
#define ticks_to_secs(t) (((t) + 1) >> 8)
-#define secs_to_ticks(s) (((s) << 8) - 1)
+#define secs_to_ticks(s) ((s) ? (((s) << 8) - 1) : 0)
#define WDT_MR_RESET 0x3FFF2FFF
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists