From 23063305dcee93317d1dd6b424de8a74f1c60d7e Mon Sep 17 00:00:00 2001 From: Kyösti Mälkki Date: Sat, 4 Jan 2020 20:05:37 +0200 Subject: drivers/pc80/rtc: Refactor some USE_OPTION_TABLE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I3a5004db021af6127de2f058bec9d84a985bae67 Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/c/coreboot/+/38183 Reviewed-by: Angel Pons Reviewed-by: Patrick Rudolph Reviewed-by: Paul Menzel Tested-by: build bot (Jenkins) --- src/drivers/pc80/rtc/mc146818rtc_boot.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/drivers/pc80/rtc/mc146818rtc_boot.c b/src/drivers/pc80/rtc/mc146818rtc_boot.c index a52e2220f1..2998c73baa 100644 --- a/src/drivers/pc80/rtc/mc146818rtc_boot.c +++ b/src/drivers/pc80/rtc/mc146818rtc_boot.c @@ -15,13 +15,12 @@ #include #include #include + #if CONFIG(USE_OPTION_TABLE) #include -#endif int cmos_chksum_valid(void) { -#if CONFIG(USE_OPTION_TABLE) unsigned char addr; u16 sum, old_sum; @@ -35,12 +34,8 @@ int cmos_chksum_valid(void) old_sum |= cmos_read(LB_CKS_LOC + 1); return sum == old_sum; -#else - return 0; -#endif } -#if CONFIG(USE_OPTION_TABLE) void sanitize_cmos(void) { if (cmos_error() || !cmos_chksum_valid() || @@ -88,7 +83,7 @@ int do_normal_boot(void) { unsigned char byte; - if (cmos_error() || !cmos_chksum_valid()) { + if (!CONFIG(USE_OPTION_TABLE) || cmos_error() || !cmos_chksum_valid()) { /* Invalid CMOS checksum detected! * Force fallback boot... */ -- cgit v1.2.3