Patchwork [08/10] hw/exynos4210_rtc.c: Fix calculating for value of year

login
register
mail settings
Submitter Peter Maydell
Date July 20, 2012, 3 p.m.
Message ID <1342796430-16636-9-git-send-email-peter.maydell@linaro.org>
Download mbox | patch
Permalink /patch/172288/
State New
Headers show

Comments

Peter Maydell - July 20, 2012, 3 p.m.
From: Oleg Ogurtsov <o.ogurtsov@samsung.com>

Signed-off-by: Oleg Ogurtsov <o.ogurtsov@samsung.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/exynos4210_rtc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Patch

diff --git a/hw/exynos4210_rtc.c b/hw/exynos4210_rtc.c
index f781020..b42586e 100644
--- a/hw/exynos4210_rtc.c
+++ b/hw/exynos4210_rtc.c
@@ -142,7 +142,7 @@  static const VMStateDescription vmstate_exynos4210_rtc_state = {
 };
 
 #define BCD3DIGITS(x) \
-    ((uint32_t)to_bcd((uint8_t)x) + \
+    ((uint32_t)to_bcd((uint8_t)(x % 100)) + \
     ((uint32_t)to_bcd((uint8_t)((x % 1000) / 100)) << 8))
 
 static void check_alarm_raise(Exynos4210RTCState *s)