From patchwork Thu Dec 19 07:44:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chun-Yi Lee X-Patchwork-Id: 3375221 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id A88FB9F314 for ; Thu, 19 Dec 2013 07:46:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id ED808200D5 for ; Thu, 19 Dec 2013 07:46:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0A91120174 for ; Thu, 19 Dec 2013 07:46:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752446Ab3LSHpm (ORCPT ); Thu, 19 Dec 2013 02:45:42 -0500 Received: from mail-pb0-f54.google.com ([209.85.160.54]:39096 "EHLO mail-pb0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752343Ab3LSHpk (ORCPT ); Thu, 19 Dec 2013 02:45:40 -0500 Received: by mail-pb0-f54.google.com with SMTP id un15so803047pbc.13 for ; Wed, 18 Dec 2013 23:45:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=JAqriWG89mtN+aIpLN6WToTGxtj4GoNLVrCK1zIJFsc=; b=of4nMSNnGIQW3PRiB0uspmVdZBo2c3QlbVSwLEXppD3qnKyWxgqKiL6oGohhpfhkFb krRNU9FUzC3KZC0ueHVeD0TG18U95yNopkN1MxxFTPKX1g5M3e4H+aP3zxRz4C7hYal6 5V8drxbY6rVxyCd+gFapGRBfYLO3wXY9mBitc+9YWMcD5+HfZErG+hz+B7gdgncpW9/T Z2tw2FTo3EjzDv8eyIJU0xBiULDCOw0V5cRt02br2VF456LTompNrCHyrSf6evlh4hPr cMK9zsO32+fYYmpp7eVQHoIwOljJKaS07aOZaUf8mjWqLx2QihnUnzkTNWas9swoY0Ja R9BA== X-Received: by 10.66.136.101 with SMTP id pz5mr70874pab.118.1387439139688; Wed, 18 Dec 2013 23:45:39 -0800 (PST) Received: from localhost.localdomain ([130.57.30.250]) by mx.google.com with ESMTPSA id fk4sm6658745pab.23.2013.12.18.23.45.30 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 18 Dec 2013 23:45:38 -0800 (PST) From: "Lee, Chun-Yi" To: "Rafael J. Wysocki" , Alessandro Zummo , "H. Peter Anvin" , Matt Fleming , Matthew Garrett Cc: Elliott@hp.com, samer.el-haj-mahmoud@hp.com, Oliver Neukum , werner@suse.com, trenn@suse.de, JBeulich@suse.com, linux-kernel@vger.kernel.org, rtc-linux@googlegroups.com, x86@kernel.org, "linux-efi@vger.kernel.org" , linux-acpi@vger.kernel.org, "Lee, Chun-Yi" Subject: [PATCH 01/14] rtc-efi: fix decrease day twice when computing year days Date: Thu, 19 Dec 2013 15:44:00 +0800 Message-Id: <1387439053-8711-2-git-send-email-jlee@suse.com> X-Mailer: git-send-email 1.6.0.2 In-Reply-To: <1387439053-8711-1-git-send-email-jlee@suse.com> References: <1387439053-8711-1-git-send-email-jlee@suse.com> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Compared with the logic in rtc_year_days of efirtc.c, the code in rtc-efi decreases value of day twice when it computing year days. That's becase rtc_year_days in rtc-lib.c already decrease day for return the year days from 0 to 365. --- drivers/rtc/rtc-efi.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/rtc/rtc-efi.c b/drivers/rtc/rtc-efi.c index 797aa02..c4c3843 100644 --- a/drivers/rtc/rtc-efi.c +++ b/drivers/rtc/rtc-efi.c @@ -35,7 +35,7 @@ static inline int compute_yday(efi_time_t *eft) { /* efi_time_t.month is in the [1-12] so, we need -1 */ - return rtc_year_days(eft->day - 1, eft->month - 1, eft->year); + return rtc_year_days(eft->day, eft->month - 1, eft->year); } /* * returns day of the week [0-6] 0=Sunday