mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
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>
This commit is contained in:
parent
35aa6715dd
commit
7038b6e4e7
1 changed files with 1 additions and 1 deletions
|
@ -133,7 +133,7 @@ static void alarm_cb (void *opaque)
|
||||||
|
|
||||||
static void set_alarm(M48t59State *NVRAM)
|
static void set_alarm(M48t59State *NVRAM)
|
||||||
{
|
{
|
||||||
int diff;
|
int64_t diff;
|
||||||
if (NVRAM->alrm_timer != NULL) {
|
if (NVRAM->alrm_timer != NULL) {
|
||||||
timer_del(NVRAM->alrm_timer);
|
timer_del(NVRAM->alrm_timer);
|
||||||
diff = qemu_timedate_diff(&NVRAM->alarm) - NVRAM->time_offset;
|
diff = qemu_timedate_diff(&NVRAM->alarm) - NVRAM->time_offset;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue