diff options
author | Felix Held <felix-coreboot@felixheld.de> | 2021-02-10 16:48:23 +0100 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2021-02-11 16:17:15 +0000 |
commit | 2e97897ea39090493e97c576717b83b6cd41b41c (patch) | |
tree | 4acf857ec22949c1827d1b53d712f2425f087851 /src | |
parent | a2db88eb5ad1a9704f1bb1e8c5ffd842e0b954d0 (diff) |
soc/amd/*/smihandler: use size_t and unsigned int
signed int should only be used when we need negative values and in those
cases the value shouldn't became negative.
Change-Id: Iefac021260ff363c76bf5cd3fe3619ea1dbabdba
Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/50486
Reviewed-by: Martin Roth <martinroth@google.com>
Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/soc/amd/picasso/smihandler.c | 5 | ||||
-rw-r--r-- | src/soc/amd/stoneyridge/smihandler.c | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/soc/amd/picasso/smihandler.c b/src/soc/amd/picasso/smihandler.c index 735fd77cf1..d478aad142 100644 --- a/src/soc/amd/picasso/smihandler.c +++ b/src/soc/amd/picasso/smihandler.c @@ -18,6 +18,7 @@ #include <amdblocks/smm.h> #include <elog.h> #include <soc/smu.h> +#include <types.h> /* bits in smm_io_trap */ #define SMM_IO_TRAP_PORT_OFFSET 16 @@ -33,7 +34,7 @@ static inline u16 get_io_address(u32 info) static void *find_save_state(int cmd) { - int core; + unsigned int core; amd64_smm_state_save_area_t *state; u32 smm_io_trap; u8 reg_al; @@ -225,7 +226,7 @@ static const struct smi_sources_t smi_sources[] = { void *get_smi_source_handler(int source) { - int i; + size_t i; for (i = 0 ; i < ARRAY_SIZE(smi_sources) ; i++) if (smi_sources[i].type == source) diff --git a/src/soc/amd/stoneyridge/smihandler.c b/src/soc/amd/stoneyridge/smihandler.c index 3a65f555e9..23951b2a58 100644 --- a/src/soc/amd/stoneyridge/smihandler.c +++ b/src/soc/amd/stoneyridge/smihandler.c @@ -16,6 +16,7 @@ #include <amdblocks/smi.h> #include <amdblocks/smm.h> #include <elog.h> +#include <types.h> /* bits in smm_io_trap */ #define SMM_IO_TRAP_PORT_OFFSET 16 @@ -31,7 +32,7 @@ static inline u16 get_io_address(u32 info) static void *find_save_state(int cmd) { - int core; + unsigned int core; amd64_smm_state_save_area_t *state; u32 smm_io_trap; u8 reg_al; @@ -220,7 +221,7 @@ static const struct smi_sources_t smi_sources[] = { void *get_smi_source_handler(int source) { - int i; + size_t i; for (i = 0 ; i < ARRAY_SIZE(smi_sources) ; i++) if (smi_sources[i].type == source) |