* [Qemu-devel] [PATCH] watchdog/aspeed: fix variable type to store reload value
@ 2017-09-19 11:17 Cédric Le Goater
2017-09-19 17:15 ` Richard Henderson
0 siblings, 1 reply; 3+ messages in thread
From: Cédric Le Goater @ 2017-09-19 11:17 UTC (permalink / raw)
To: Peter Maydell
Cc: qemu-devel, Andrew Jeffery, Anton D . Kachalov,
Cédric Le Goater
Initially from Anton D. Kachalov" <mouse@yandex-team.ru> but the SoB was
missing.
Signed-off-by: Cédric Le Goater <clg@kaod.org>
[clg: change commit log and subject]
---
hw/watchdog/wdt_aspeed.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/watchdog/wdt_aspeed.c b/hw/watchdog/wdt_aspeed.c
index 22bce364d7b5..b8e0e9a75999 100644
--- a/hw/watchdog/wdt_aspeed.c
+++ b/hw/watchdog/wdt_aspeed.c
@@ -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] * 1000UL;
}
if (aspeed_wdt_is_enabled(s)) {
--
2.13.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] watchdog/aspeed: fix variable type to store reload value
2017-09-19 11:17 [Qemu-devel] [PATCH] watchdog/aspeed: fix variable type to store reload value Cédric Le Goater
@ 2017-09-19 17:15 ` Richard Henderson
2017-09-20 6:21 ` Cédric Le Goater
0 siblings, 1 reply; 3+ messages in thread
From: Richard Henderson @ 2017-09-19 17:15 UTC (permalink / raw)
To: Cédric Le Goater, Peter Maydell
Cc: Andrew Jeffery, Anton D . Kachalov, qemu-devel
On 09/19/2017 06:17 AM, Cédric Le Goater wrote:
> + 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] * 1000UL;
UL does not help ilp32 hosts. Need ULL or an explicit cast.
r~
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] watchdog/aspeed: fix variable type to store reload value
2017-09-19 17:15 ` Richard Henderson
@ 2017-09-20 6:21 ` Cédric Le Goater
0 siblings, 0 replies; 3+ messages in thread
From: Cédric Le Goater @ 2017-09-20 6:21 UTC (permalink / raw)
To: Richard Henderson, Peter Maydell
Cc: Andrew Jeffery, Anton D . Kachalov, qemu-devel
On 09/19/2017 07:15 PM, Richard Henderson wrote:
> On 09/19/2017 06:17 AM, Cédric Le Goater wrote:
>> + 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] * 1000UL;
>
> UL does not help ilp32 hosts. Need ULL or an explicit cast.
ok. I will send a fix.
Thanks,
C.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-09-20 6:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-19 11:17 [Qemu-devel] [PATCH] watchdog/aspeed: fix variable type to store reload value Cédric Le Goater
2017-09-19 17:15 ` Richard Henderson
2017-09-20 6:21 ` Cédric Le Goater
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).