From 4c2890d47ef03e5c638a9ac81d14cf3755f64cfc Mon Sep 17 00:00:00 2001 From: Sridhar Siricilla Date: Wed, 9 Dec 2020 00:28:30 +0530 Subject: soc/inte/common: Replace #if macro with if C-language constuct This patch modifies CSE Lite driver to use 'if' C-lanugage construct instead of #if macro and adds 'if SOC_INTEL_CSE_RW_UPDATE' to the prompts of CSE Update related KConfigs to prevent appearing them in the menu. TEST=Built the code for drawcia Signed-off-by: Sridhar Siricilla Change-Id: Iecd5cf56ecd280de920f479e174762fe6b4164b0 Reviewed-on: https://review.coreboot.org/c/coreboot/+/48494 Tested-by: build bot (Jenkins) Reviewed-by: Karthik Ramasubramanian Reviewed-by: Furquan Shaikh --- src/soc/intel/common/block/cse/cse_lite.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src/soc/intel/common/block/cse/cse_lite.c') diff --git a/src/soc/intel/common/block/cse/cse_lite.c b/src/soc/intel/common/block/cse/cse_lite.c index 8e89723334..1d261eaf36 100644 --- a/src/soc/intel/common/block/cse/cse_lite.c +++ b/src/soc/intel/common/block/cse/cse_lite.c @@ -429,7 +429,6 @@ static bool cse_fix_data_failure_err(const struct cse_bp_info *cse_bp_info) return cse_boot_to_rw(cse_bp_info); } -#if CONFIG(SOC_INTEL_CSE_RW_UPDATE) static const struct fw_version *cse_get_bp_entry_version(enum boot_partition_id bp, const struct cse_bp_info *bp_info) { @@ -775,7 +774,6 @@ static uint8_t cse_fw_update(const struct cse_bp_info *cse_bp_info) return 0; } -#endif void cse_fw_sync(void *unused) { @@ -804,12 +802,12 @@ void cse_fw_sync(void *unused) * If SOC_INTEL_CSE_RW_UPDATE is defined , then trigger CSE firmware update. The driver * triggers recovery if CSE CBFS RW metadata or CSE CBFS RW blob is not available. */ -#if CONFIG(SOC_INTEL_CSE_RW_UPDATE) - uint8_t rv; - rv = cse_fw_update(&cse_bp_info.bp_info); - if (rv) - cse_trigger_recovery(rv); -#endif + if (CONFIG(SOC_INTEL_CSE_RW_UPDATE)) { + uint8_t rv; + rv = cse_fw_update(&cse_bp_info.bp_info); + if (rv) + cse_trigger_recovery(rv); + } if (!cse_boot_to_rw(&cse_bp_info.bp_info)) { printk(BIOS_ERR, "cse_lite: Failed to switch to RW\n"); -- cgit v1.2.3