From patchwork Tue Dec 11 22:49:44 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [v2,1/6] hw/ds1338.c: Correct bug in conversion to BCD. From: Antoine Mathys X-Patchwork-Id: 205329 Message-Id: <50C7B888.6000807@gmail.com> To: qemu-devel@nongnu.org Cc: Peter Maydell , paul@codesourcery.com Date: Tue, 11 Dec 2012 23:49:44 +0100 Signed-off-by: Antoine Mathys Reviewed-by: Peter Maydell --- hw/ds1338.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/ds1338.c b/hw/ds1338.c index b576d56..faaa4a0 100644 --- a/hw/ds1338.c +++ b/hw/ds1338.c @@ -57,9 +57,9 @@ static void capture_current_time(DS1338State *s) } else { s->nvram[2] = to_bcd(now.tm_hour); } - s->nvram[3] = to_bcd(now.tm_wday) + 1; + s->nvram[3] = to_bcd(now.tm_wday + 1); s->nvram[4] = to_bcd(now.tm_mday); - s->nvram[5] = to_bcd(now.tm_mon) + 1; + s->nvram[5] = to_bcd(now.tm_mon + 1); s->nvram[6] = to_bcd(now.tm_year - 100); }