* [PATCH] rtc-efi: avoid subtract day twice when computing year days
@ 2014-04-02 3:55 Lee, Chun-Yi
0 siblings, 0 replies; only message in thread
From: Lee, Chun-Yi @ 2014-04-02 3:55 UTC (permalink / raw)
To: Alessandro Zummo; +Cc: rtc-linux, linux-kernel, Lee, Chun-Yi
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 <jlee@suse.com>
---
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2014-04-02 3:57 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-02 3:55 [PATCH] rtc-efi: avoid subtract day twice when computing year days Lee, Chun-Yi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®