Skip to contentSkip to conversation

watchdog/aspeed: fix variable type to store reload value

PATCH Applied Cédric Le Goater 3 participants 3 messages Sep 20, 2017 – Oct 9, 2017 Arm/Aspeed machine support

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 watchdog/aspeed: fix variable type to store reload value

Initially from Anton D. Kachalov" <[email protected]> but the SoB was missing.

[clg: change commit log and subject
replace UL suffix by ULL ]

---
 hw/watchdog/wdt_aspeed.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
hw/watchdog/wdt_aspeed.c +2 -2
index 22bce364d7b5..95f6ad186d72 100644
@@ -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)) {
Signature · 1 line
2.13.5
Acked-by on v2 1/1
#1 lore raw
Quoted 7 lines · Cédric Le Goater

Initially from Anton D. Kachalov" <[email protected]> but the SoB was missing.

[clg: change commit log and subject
      replace UL suffix by ULL ]

Quoted 24 lines

---
 hw/watchdog/wdt_aspeed.c | 4 ++--

 1 file changed, 2 insertions(+), 2 deletions(-)

hw/watchdog/wdt_aspeed.c +0 -0
index 22bce364d7b5..95f6ad186d72 100644
@@ -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)) {