summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLee, Chun-Yi <joeyli.kernel@gmail.com>2014-06-06 14:35:48 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-06 16:08:07 -0700
commit809d9627087e1db63b8672c1f264af73b13116fb (patch)
tree849cc951fc21b047ae6132fb3f2c2afb86291e6c
parent6b1a5235498d6002d40cb0503365154e49c53122 (diff)
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 <jlee@suse.com> Cc: Alessandro Zummo <a.zummo@towertech.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--drivers/rtc/rtc-efi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/rtc/rtc-efi.c b/drivers/rtc/rtc-efi.c
index 797aa0252ba..c4c38431012 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