Angel Pons has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/52566 )
Change subject: option.h: Drop type-unsafe {get,set}_option() API ......................................................................
option.h: Drop type-unsafe {get,set}_option() API
Change-Id: I5a9852b1fb66d609238ab7324f28a5e397c030ae Signed-off-by: Angel Pons th3fanbus@gmail.com --- M src/include/option.h 1 file changed, 10 insertions(+), 19 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/66/52566/1
diff --git a/src/include/option.h b/src/include/option.h index 26cd0d5..4de032b 100644 --- a/src/include/option.h +++ b/src/include/option.h @@ -10,31 +10,22 @@ enum cb_err cmos_set_option(const char *name, void *val); enum cb_err cmos_get_option(void *dest, const char *name);
-static inline enum cb_err set_option(const char *name, void *val) -{ - if (CONFIG(USE_OPTION_TABLE)) - return cmos_set_option(name, val); - - return CB_CMOS_OTABLE_DISABLED; -} - -static inline enum cb_err get_option(void *dest, const char *name) -{ - if (CONFIG(USE_OPTION_TABLE)) - return cmos_get_option(dest, name); - - return CB_CMOS_OTABLE_DISABLED; -} - static inline enum cb_err set_int_option(const char *name, int value) { - return set_option(name, &value); + if (CONFIG(USE_OPTION_TABLE)) + return cmos_set_option(name, &value); + + return CB_CMOS_OTABLE_DISABLED; }
static inline int get_int_option(const char *name, const int fallback) { - int value = 0; - return get_option(&value, name) == CB_SUCCESS ? value : fallback; + if (CONFIG(USE_OPTION_TABLE)) { + int value = 0; + if (cmos_get_option(&value, name) == CB_SUCCESS) + return value; + } + return fallback; }
#endif /* _OPTION_H_ */