watchdog/aspeed: fix variable type to store reload value
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
@@ -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
Quoted 7 lines · Cédric Le Goater
Initially from Anton D. Kachalov" <[email protected]> but the SoB was missing.
Signed-off-by Cédric Le Goater <[email protected]>[clg: change commit log and subject
replace UL suffix by ULL ]Signed-off-by Cédric Le Goater <[email protected]>
Quoted 24 lines
---
hw/watchdog/wdt_aspeed.c | 4 ++--1 file changed, 2 insertions(+), 2 deletions(-)hw/watchdog/wdt_aspeed.c +0
-0@@ -100,13 +100,13 @@ static uint64_t aspeed_wdt_read(void *opaque, hwaddr offset, unsigned size)
static voidaspeed_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)) {
Peter Maydell
AppliedQuoted 10 lines · Andrew Jeffery
Quoted 7 lines · Cédric Le Goater
Initially from Anton D. Kachalov" <[email protected]> but the SoB was missing.
Signed-off-by Cédric Le Goater <[email protected]>[clg: change commit log and subject
replace UL suffix by ULL ]Signed-off-by Cédric Le Goater <[email protected]>Acked-by Andrew Jeffery <[email protected]>
Applied to target-arm.next, thanks.
-- PMM