diff mbox series

[for-8.2,2/4] hw/rtc/twl92230: Use int64_t for sec_offset and alm_sec

Message ID 20230720155902.1590362-3-peter.maydell@linaro.org
State Superseded
Headers show
Series rtc devices: Avoid putting time_t in 32-bit variables | expand

Commit Message

Peter Maydell July 20, 2023, 3:59 p.m. UTC
In the twl92230 device, use int64_t for the two state fields
sec_offset and alm_sec, because we set these to values that
are either time_t or differences between two time_t values.

These fields aren't saved in vmstate anywhere, so we can
safely widen them.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
I have a suspicion that really these fields *should* be
being migrated, but this device is only used in the n800
and n810 boards, so I'm not going to investigate how broken
migration/vmsave is there...
---
 hw/rtc/twl92230.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Philippe Mathieu-Daudé July 21, 2023, 9:09 a.m. UTC | #1
On 20/7/23 17:59, Peter Maydell wrote:
> In the twl92230 device, use int64_t for the two state fields
> sec_offset and alm_sec, because we set these to values that
> are either time_t or differences between two time_t values.
> 
> These fields aren't saved in vmstate anywhere, so we can
> safely widen them.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> I have a suspicion that really these fields *should* be
> being migrated, but this device is only used in the n800
> and n810 boards, so I'm not going to investigate how broken
> migration/vmsave is there...
> ---
>   hw/rtc/twl92230.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
diff mbox series

Patch

diff --git a/hw/rtc/twl92230.c b/hw/rtc/twl92230.c
index d8534dad949..64c61c3daeb 100644
--- a/hw/rtc/twl92230.c
+++ b/hw/rtc/twl92230.c
@@ -65,8 +65,8 @@  struct MenelausState {
         struct tm tm;
         struct tm new;
         struct tm alm;
-        int sec_offset;
-        int alm_sec;
+        int64_t sec_offset;
+        int64_t alm_sec;
         int next_comp;
     } rtc;
     uint16_t rtc_next_vmstate;