From patchwork Tue Dec 11 22:49:44 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antoine Mathys X-Patchwork-Id: 205329 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 89C742C0098 for ; Wed, 12 Dec 2012 09:50:05 +1100 (EST) Received: from localhost ([::1]:35368 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TiYeJ-0007zy-FV for incoming@patchwork.ozlabs.org; Tue, 11 Dec 2012 17:50:03 -0500 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=evR0VXZfoniv2cm9osWrf5CRS3OCZNmv/95wJhbJ/Z4=; b=yXkg8css/qF7VfDbRlcF+8srnP2lAKo/B98hGvZYoK8Z10A4FYDNSZJdPH3hNShABP a75wNLRTXSVGVgPZ4MczMevMj79rvv8Y+oQdvoSS+rx1WsgSuUCbmx08igwRk7eh8czt mYemD4T4zBzn+vwARTjJW77cLGpuMA24P5Lz7ceR83oiddvXN28XIBntWo9hAsbABYtT kWvBPcWVI9E7rrzdpJnshcFcKmbQYZF0QpX/wRYW2fUR1xhbUFMxhtir2zFB7JEs+LeJ HOTtC91RzM7euKQDJ05yGVZktEJDlTOKRNYAeu0eNhGlfNWFs4UFh81VPvzrP7NytfJT Tv/Q== Received: by 10.14.184.131 with SMTP id s3mr64176159eem.38.1355266186231; Tue, 11 Dec 2012 14:49:46 -0800 (PST) Received: from [192.168.1.33] (adsl-84-227-232-139.adslplus.ch. [84.227.232.139]) by mx.google.com with ESMTPS id r1sm52490396eeo.2.2012.12.11.14.49.44 (version=SSLv3 cipher=OTHER); Tue, 11 Dec 2012 14:49:45 -0800 (PST) Message-ID: <50C7B888.6000807@gmail.com> Date: Tue, 11 Dec 2012 23:49:44 +0100 From: Antoine Mathys User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: qemu-devel@nongnu.org References: <50C7B767.8020406@gmail.com> In-Reply-To: <50C7B767.8020406@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.215.173 Cc: Peter Maydell , paul@codesourcery.com Subject: [Qemu-devel] [PATCH v2 1/6] hw/ds1338.c: Correct bug in conversion to BCD. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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); }