summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorJakub Czapiga <jacz@semihalf.com>2021-04-14 16:48:10 +0200
committerPatrick Georgi <pgeorgi@google.com>2021-04-15 07:39:31 +0000
commit4ae7ee6e2b9f920b012ea9f60d5f5bbb32e62f3a (patch)
tree6bec8fbf1cca421d720a3546a44f276a71fd0f2d /src/lib
parenta4819b3c31b86950de3ccbe848ec50d6f4d3bdb8 (diff)
downloadcoreboot-4ae7ee6e2b9f920b012ea9f60d5f5bbb32e62f3a.tar.xz
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>
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/rtc.c3
1 files changed, 0 insertions, 3 deletions
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);