From: Lee, Chun-Yi Date: Thu, 22 May 2014 00:43:48 +0000 (+1000) Subject: drivers/rtc/rtc-efi.c: avoid subtracting day twice when computing year days X-Git-Tag: next-20140530~2^2~129 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=d5245207b9725813760d3add97af9eea17db0239;p=karo-tx-linux.git drivers/rtc/rtc-efi.c: avoid subtracting day twice when computing year days 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. rtc-lib.c::rtc_year_days() has already decrease days and return the year days from 0 to 365. Signed-off-by: Lee, Chun-Yi Cc: Alessandro Zummo Signed-off-by: Andrew Morton --- diff --git a/drivers/rtc/rtc-efi.c b/drivers/rtc/rtc-efi.c index 797aa0252ba9..c4c38431012e 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