From patchwork Wed Apr 2 03:55:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lee, Chun-Yi" X-Patchwork-Id: 336229 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-pb0-x237.google.com (mail-pb0-x237.google.com [IPv6:2607:f8b0:400e:c01::237]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 230EF1400F3 for ; Wed, 2 Apr 2014 14:57:58 +1100 (EST) Received: by mail-pb0-f55.google.com with SMTP id jt11sf2372085pbb.10 for ; Tue, 01 Apr 2014 20:57:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=mime-version:from:to:cc:subject:date:message-id:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:list-post:list-help:list-archive:sender:list-subscribe :list-unsubscribe:content-type; bh=qsc0qJnkjalJ4CC/tnOeRSbOhPxwVGs6aRI7jD/qVEI=; b=MgP7R039HQxzGDCkeU8/45P1xoo1gFt8ASRgb/YHwPQDH2S3fEDhPTZnFDintfdYU0 aK8oRjqDuaScbHZviJBzAHfuAgbtP2zdRBVPJfJhycI+nQjiFAZO9aICW8fOEBWOhLDO ckZrWjtnj85gooD3QpgP3veGaJk7xUoxn/PE85R+JZfZGK1uisbSni9SRUO6tXWZ3Stz nyrk7FmiFmagjR7MH9bd9BRC1Njk2z0f+YgFFpzr4o2vEN1rL/gXZ6QeAVEODkK4cfYQ Hn2jYcGHGQlBNP9Gu01Cy/vaou7XdkoTZit67ZP72yn/SkWQdugZ3HxuSEkPMtE7kFqB CfHg== X-Received: by 10.182.60.101 with SMTP id g5mr1774obr.16.1396411076078; Tue, 01 Apr 2014 20:57:56 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: rtc-linux@googlegroups.com Received: by 10.182.55.73 with SMTP id q9ls174469obp.98.gmail; Tue, 01 Apr 2014 20:57:55 -0700 (PDT) X-Received: by 10.182.109.200 with SMTP id hu8mr15689495obb.20.1396411075663; Tue, 01 Apr 2014 20:57:55 -0700 (PDT) Received: from mail-pb0-x22a.google.com (mail-pb0-x22a.google.com [2607:f8b0:400e:c01::22a]) by gmr-mx.google.com with ESMTPS id g1si296764pbw.2.2014.04.01.20.57.55 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 01 Apr 2014 20:57:55 -0700 (PDT) Received-SPF: pass (google.com: domain of joeyli.kernel@gmail.com designates 2607:f8b0:400e:c01::22a as permitted sender) client-ip=2607:f8b0:400e:c01::22a; Received: by mail-pb0-f42.google.com with SMTP id rr13so10904349pbb.29 for ; Tue, 01 Apr 2014 20:57:55 -0700 (PDT) X-Received: by 10.66.164.135 with SMTP id yq7mr16671716pab.126.1396411075540; Tue, 01 Apr 2014 20:57:55 -0700 (PDT) Received: from linux-rxt1.site ([130.57.30.250]) by mx.google.com with ESMTPSA id qh2sm3224349pab.13.2014.04.01.20.57.52 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Apr 2014 20:57:54 -0700 (PDT) From: "Lee, Chun-Yi" To: Alessandro Zummo Cc: rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org, "Lee, Chun-Yi" Subject: [rtc-linux] [PATCH] rtc-efi: avoid subtract day twice when computing year days Date: Wed, 2 Apr 2014 11:55:25 +0800 Message-Id: <1396410925-5704-1-git-send-email-jlee@suse.com> X-Mailer: git-send-email 1.8.4.5 X-Original-Sender: joeyli.kernel@gmail.com X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of joeyli.kernel@gmail.com designates 2607:f8b0:400e:c01::22a as permitted sender) smtp.mail=joeyli.kernel@gmail.com; dkim=pass header.i=@gmail.com; dmarc=pass (p=NONE dis=NONE) header.from=gmail.com Reply-To: rtc-linux@googlegroups.com Precedence: list Mailing-list: list rtc-linux@googlegroups.com; contact rtc-linux+owners@googlegroups.com List-ID: X-Google-Group-Id: 712029733259 List-Post: , List-Help: , List-Archive: Sender: rtc-linux@googlegroups.com List-Subscribe: , List-Unsubscribe: , Compared source code of rtc-lib.c::rtc_year_days() with efirtc.c::rtc_year_days(), found the code in rtc-efi decreases value of day twice when it computing year days. The tc-lib.c::rtc_year_days() has already decrease day and return the year days from 0 to 365. Signed-off-by: Lee, Chun-Yi --- 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