From 4ae7ee6e2b9f920b012ea9f60d5f5bbb32e62f3a Mon Sep 17 00:00:00 2001 From: Jakub Czapiga Date: Wed, 14 Apr 2021 16:48:10 +0200 Subject: 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 Change-Id: I25e2e6a1c9b2fb1ac2576e028b580db0ea474d37 Reviewed-on: https://review.coreboot.org/c/coreboot/+/52347 Tested-by: build bot (Jenkins) Reviewed-by: Paul Fagerburg --- src/lib/rtc.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'src/lib') diff --git a/src/lib/rtc.c b/src/lib/rtc.c index 258f4ac25c..5e03cfae1e 100644 --- a/src/lib/rtc.c +++ b/src/lib/rtc.c @@ -22,9 +22,6 @@ static const char *const weekdays[] = { /* 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); -- cgit v1.2.3