src: Retype option API to use unsigned integers

The CMOS option system does not support negative integers. Thus, retype
and rename the option API functions to reflect this.

Change-Id: Id3480e5cfc0ec90674def7ef0919e0b7ac5b19b3
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/52672
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Rudolph <siro@das-labor.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by:  Felix Singer <felixsinger@posteo.net>
This commit is contained in:
Angel Pons
2021-04-26 17:10:28 +02:00
committed by Felix Held
parent a2cf34129f
commit 88dcb3179b
58 changed files with 113 additions and 113 deletions

View File

@@ -10,7 +10,7 @@ void sanitize_cmos(void);
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_int_option(const char *name, int value)
static inline enum cb_err set_uint_option(const char *name, unsigned int value)
{
if (CONFIG(USE_OPTION_TABLE))
return cmos_set_option(name, &value);
@@ -18,10 +18,10 @@ static inline enum cb_err set_int_option(const char *name, int value)
return CB_CMOS_OTABLE_DISABLED;
}
static inline int get_int_option(const char *name, const int fallback)
static inline int get_uint_option(const char *name, const unsigned int fallback)
{
if (CONFIG(USE_OPTION_TABLE)) {
int value = 0;
unsigned int value = 0;
if (cmos_get_option(&value, name) == CB_SUCCESS)
return value;
}