From: Boris BREZILLON Date: Sun, 3 Nov 2013 17:52:42 +0000 (+0100) Subject: watchdog: at91sam9_wdt: fix secs_to_ticks X-Git-Tag: firefly_0821_release~176^2~4527^2~5 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=1444797fc178b58e91cf29a438efd05dd890d43a;p=firefly-linux-kernel-4.4.55.git 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 Reviewed-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck --- diff --git a/drivers/watchdog/at91sam9_wdt.c b/drivers/watchdog/at91sam9_wdt.c index 9bd089ebb70f..65f469145950 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