Skip to content

Commit

Permalink
drivers/rtc/rtc-efi.c: avoid subtracting day twice when computing yea…
Browse files Browse the repository at this point in the history
…r days

commit 809d962 upstream.

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>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
  • Loading branch information
Lee, Chun-Yi authored and Jiri Slaby committed Aug 26, 2014
1 parent 8df01ee commit e7afccd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/rtc/rtc-efi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e7afccd

Please sign in to comment.