Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/52347 )
Change subject: lib/rtc: Remove unnecessary year constraint in rtc_calc_weekday ......................................................................
lib/rtc: Remove unnecessary year constraint in rtc_calc_weekday
Algorithm used to calculate weekday is now based on Zeller's rule, so it does not need if statement constraining year to 1971 and later.
Signed-off-by: Jakub Czapiga jacz@semihalf.com Change-Id: I25e2e6a1c9b2fb1ac2576e028b580db0ea474d37 Reviewed-on: https://review.coreboot.org/c/coreboot/+/52347 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Paul Fagerburg pfagerburg@chromium.org --- M src/lib/rtc.c 1 file changed, 0 insertions(+), 3 deletions(-)
Approvals: build bot (Jenkins): Verified Paul Fagerburg: Looks good to me, approved
diff --git a/src/lib/rtc.c b/src/lib/rtc.c index 258f4ac..5e03cfa 100644 --- a/src/lib/rtc.c +++ b/src/lib/rtc.c @@ -22,9 +22,6 @@ /* Zeller's rule */ static int rtc_calc_weekday(struct rtc_time *tm) { - if (tm->year < 1971) - return -1; - /* In Zeller's rule, January and February are treated as if they are months 13 and 14 of the previous year (March is still month 3) */ const int zyear = ((tm->mon < 3) ? tm->year - 1 : tm->year);