Jakub Czapiga has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/75835?usp=email )
Change subject: lib/fw_config: Make basic functions always available ......................................................................
lib/fw_config: Make basic functions always available
Make fw_config_get() inline and return UNDEFINED_FW_CONFIG for CONFIG_FW_CONFIG=n. Make fw_config_is_provisioned() return false for disabled fw_config.
Signed-off-by: Jakub Czapiga jacz@semihalf.com Change-Id: I2ea21b19339cd93ba78dbe25213cbfb40e012937 --- M src/include/fw_config.h M src/lib/fw_config.c 2 files changed, 14 insertions(+), 7 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/35/75835/1
diff --git a/src/include/fw_config.h b/src/include/fw_config.h index 9f5e4b8..9bbcf59 100644 --- a/src/include/fw_config.h +++ b/src/include/fw_config.h @@ -42,6 +42,8 @@ .mask = FW_CONFIG_FIELD_##__field##_MASK, \ })
+#if CONFIG(FW_CONFIG) + /** * fw_config_get() - Provide firmware configuration value. * @@ -49,8 +51,6 @@ */ uint64_t fw_config_get(void);
-#if CONFIG(FW_CONFIG) - /** * fw_config_get_field() - Provide firmware configuration field value. * @field: Structure containing field name and mask @@ -102,6 +102,18 @@
#else
+static inline uint64_t fw_config_get(void) +{ + /* If fw_config is disabled, then its value is undefined. */ + return UNDEFINED_FW_CONFIG; +} + +static inline bool fw_config_is_provisioned(void) +{ + /* If fw_config is disabled, then it is unprovisioned. */ + return false; +} + static inline bool fw_config_probe(const struct fw_config *match) { /* Always return true when probing with disabled fw_config. */ diff --git a/src/lib/fw_config.c b/src/lib/fw_config.c index e1fbe74..268be07 100644 --- a/src/lib/fw_config.c +++ b/src/lib/fw_config.c @@ -95,11 +95,6 @@ return false; }
-bool fw_config_is_provisioned(void) -{ - return fw_config_get() != UNDEFINED_FW_CONFIG; -} - bool fw_config_probe_dev(const struct device *dev, const struct fw_config **matching_probe) { const struct fw_config *probe;