From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:45923) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TiYe7-0007zh-IT for qemu-devel@nongnu.org; Tue, 11 Dec 2012 17:49:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TiYe3-0006ua-Hq for qemu-devel@nongnu.org; Tue, 11 Dec 2012 17:49:51 -0500 Received: from mail-ea0-f173.google.com ([209.85.215.173]:54780) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TiYe3-0006ts-5W for qemu-devel@nongnu.org; Tue, 11 Dec 2012 17:49:47 -0500 Received: by mail-ea0-f173.google.com with SMTP id i13so1907eaa.4 for ; Tue, 11 Dec 2012 14:49:46 -0800 (PST) Message-ID: <50C7B888.6000807@gmail.com> Date: Tue, 11 Dec 2012 23:49:44 +0100 From: Antoine Mathys MIME-Version: 1.0 References: <50C7B767.8020406@gmail.com> In-Reply-To: <50C7B767.8020406@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH v2 1/6] hw/ds1338.c: Correct bug in conversion to BCD. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , paul@codesourcery.com Signed-off-by: Antoine Mathys --- 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); } -- 1.7.10.4