]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
watchdog: asm9260_wdt: don't round closest with get_timeleft
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Mon, 17 Jul 2017 17:12:24 +0000 (19:12 +0200)
committerWim Van Sebroeck <wim@iguana.be>
Sat, 9 Sep 2017 18:25:34 +0000 (20:25 +0200)
We should never return more time left than there actually is. So, switch
to a plain divider instead of DIV_ROUND_CLOSEST.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
drivers/watchdog/asm9260_wdt.c

index 186fac4cccf5ade13da2826ad4ced998ebdf0888..7dd0da644a7f68fc7b1163d1eb12d07fd8c04f3b 100644 (file)
@@ -82,7 +82,7 @@ static unsigned int asm9260_wdt_gettimeleft(struct watchdog_device *wdd)
 
        counter = ioread32(priv->iobase + HW_WDTV);
 
-       return DIV_ROUND_CLOSEST(counter, priv->wdt_freq);
+       return counter / priv->wdt_freq;
 }
 
 static int asm9260_wdt_updatetimeout(struct watchdog_device *wdd)