From mboxrd@z Thu Jan 1 00:00:00 1970 From: "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> References: <1387439053-8711-1-git-send-email-jlee@suse.com> Return-path: In-Reply-To: <1387439053-8711-1-git-send-email-jlee-IBi9RG/b67k@public.gmane.org> Sender: linux-efi-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: "Rafael J. Wysocki" , Alessandro Zummo , "H. Peter Anvin" , Matt Fleming , Matthew Garrett Cc: Elliott-VXdhtT5mjnY@public.gmane.org, samer.el-haj-mahmoud-VXdhtT5mjnY@public.gmane.org, Oliver Neukum , werner-IBi9RG/b67k@public.gmane.org, trenn-l3A5Bk7waGM@public.gmane.org, JBeulich-IBi9RG/b67k@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, rtc-linux-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org, x86-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, "linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , linux-acpi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, "Lee, Chun-Yi" List-Id: linux-efi@vger.kernel.org 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 -- 1.6.4.2