diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2023-08-31 09:45:17 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2023-08-31 09:45:17 +0100 |
commit | 7038b6e4e71d9fb3a234e00da31c222d3e97dd5c (patch) | |
tree | 14fcdfccf99aff786943d13a20e08c7a05a98694 /hw | |
parent | 35aa6715ddcd9748bae5bc01563331e8eae8d7cf (diff) | |
download | qemu-7038b6e4e71d9fb3a234e00da31c222d3e97dd5c.zip qemu-7038b6e4e71d9fb3a234e00da31c222d3e97dd5c.tar.gz qemu-7038b6e4e71d9fb3a234e00da31c222d3e97dd5c.tar.bz2 |
hw/rtc/m48t59: Use 64-bit arithmetic in set_alarm()
In the m48t59 device we almost always use 64-bit arithmetic when
dealing with time_t deltas. The one exception is in set_alarm(),
which currently uses a plain 'int' to hold the difference between two
time_t values. Switch to int64_t instead to avoid any possible
overflow issues.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/rtc/m48t59.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/rtc/m48t59.c b/hw/rtc/m48t59.c index ec3e56e..2e2c849 100644 --- a/hw/rtc/m48t59.c +++ b/hw/rtc/m48t59.c @@ -133,7 +133,7 @@ static void alarm_cb (void *opaque) static void set_alarm(M48t59State *NVRAM) { - int diff; + int64_t diff; if (NVRAM->alrm_timer != NULL) { timer_del(NVRAM->alrm_timer); diff = qemu_timedate_diff(&NVRAM->alarm) - NVRAM->time_offset; |