From patchwork Thu Dec 19 07:51:42 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: 3375261 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2FAECC0D4A for ; Thu, 19 Dec 2013 07:53:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6574A2062C for ; Thu, 19 Dec 2013 07:53:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 895D12062D for ; Thu, 19 Dec 2013 07:53:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751357Ab3LSHxY (ORCPT ); Thu, 19 Dec 2013 02:53:24 -0500 Received: from mail-pa0-f51.google.com ([209.85.220.51]:50562 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750975Ab3LSHxV (ORCPT ); Thu, 19 Dec 2013 02:53:21 -0500 Received: by mail-pa0-f51.google.com with SMTP id fa1so816529pad.38 for ; Wed, 18 Dec 2013 23:53:21 -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=palH1tTtRiCT1AX1hA344k+yfWn39ecimTl+zMzL9mchP+2WFF0rWmqontA9szMbPu hifL+xfBr6QUsGVwL3duaM5BmkczH17aWZHEhFpbF6BPCcPYCCtFBvcV1O2ZCYst7ItM 2FEEDVwC4d60x9InrwteToViT2t1/HiOgpfRAl+2H4F/Q/2QhAn7PhJSO9aBui2oAyTG jsInclrBd+sSWHTBhDzopUOkJastF13sVbszVP1VXhRqauuFXGo7T+iysV45L44NumTk g3MEj29YuxNPuB4V0wJQFvNvOZlKgzkMvX4FGDCJGNmxBumE5qFsRW8yQoyYRIe4QOL6 e3vQ== X-Received: by 10.66.156.106 with SMTP id wd10mr38997200pab.125.1387439601190; Wed, 18 Dec 2013 23:53:21 -0800 (PST) Received: from localhost.localdomain ([130.57.30.250]) by mx.google.com with ESMTPSA id qp15sm5173154pbb.2.2013.12.18.23.53.12 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 18 Dec 2013 23:53:20 -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:51:42 +0800 Message-Id: <1387439515-8926-2-git-send-email-jlee@suse.com> X-Mailer: git-send-email 1.6.0.2 In-Reply-To: <1387439515-8926-1-git-send-email-jlee@suse.com> References: <1387439515-8926-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