]> xenbits.xensource.com Git - people/pauldu/qemu.git/commitdiff
watchdog/aspeed: fix variable type to store reload value
authorCédric Le Goater <clg@kaod.org>
Thu, 12 Oct 2017 12:20:06 +0000 (13:20 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 12 Oct 2017 12:20:06 +0000 (13:20 +0100)
Initially from Anton D. Kachalov" <mouse@yandex-team.ru> but the SoB was
missing.

Signed-off-by: Cédric Le Goater <clg@kaod.org>
Acked-by: Andrew Jeffery <andrew@aj.id.au>
Message-id: 20170920064915.30027-1-clg@kaod.org
[clg: change commit log and subject
      replace UL suffix by ULL ]
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/watchdog/wdt_aspeed.c

index 22bce364d7b56cd660bbff227a1ea8725f9ac3e6..95f6ad186d72a67449dc44679cbe921fa1d506b1 100644 (file)
@@ -100,13 +100,13 @@ static uint64_t aspeed_wdt_read(void *opaque, hwaddr offset, unsigned size)
 
 static void aspeed_wdt_reload(AspeedWDTState *s, bool pclk)
 {
-    uint32_t reload;
+    uint64_t reload;
 
     if (pclk) {
         reload = muldiv64(s->regs[WDT_RELOAD_VALUE], NANOSECONDS_PER_SECOND,
                           s->pclk_freq);
     } else {
-        reload = s->regs[WDT_RELOAD_VALUE] * 1000;
+        reload = s->regs[WDT_RELOAD_VALUE] * 1000ULL;
     }
 
     if (aspeed_wdt_is_enabled(s)) {