rtc: Fix rtc_calc_weekday
commitb47c633c31a935a73e4d88d45437682e7b10310f
authorTim Wawrzynczak <twawrzynczak@chromium.org>
Thu, 21 Feb 2019 22:02:26 +0000 (21 15:02 -0700)
committerPatrick Georgi <pgeorgi@google.com>
Wed, 27 Feb 2019 11:07:11 +0000 (27 11:07 +0000)
tree4a1c1d5400c2cdee5290bdede790a9c8b389a653
parentec645cb086883f8bf147cce584d2fe31536a9537
rtc: Fix rtc_calc_weekday

This function appeared previously unused (called only from rtc_display, also unused),
but it returned an incorrect weekday.  Change the algorithm to use Zeller's Rule, a
well-known algorithm for calculuating weekdays.

Change-Id: Ibce6822942f8d9d9f39c2b6065cd785dca9e8e09
Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-on: https://review.coreboot.org/c/31557
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
src/lib/rtc.c