summaryrefslogtreecommitdiffstats
path: root/dmi.c
diff options
context:
space:
mode:
authorNico Huber <nico.h@gmx.de>2018-12-23 20:03:35 +0100
committerNico Huber <nico.h@gmx.de>2019-07-31 08:26:59 +0000
commit519be66fc59558971dd653afe69ccaf1a633b492 (patch)
tree74f0912de156a86d56111f377db080246e5205e9 /dmi.c
parentef78de4a21323b8c459337356289218211f2c5ce (diff)
downloadflashrom-519be66fc59558971dd653afe69ccaf1a633b492.tar.gz
flashrom-519be66fc59558971dd653afe69ccaf1a633b492.tar.bz2
flashrom-519be66fc59558971dd653afe69ccaf1a633b492.zip
Fix -Wsign-compare trouble
Mostly by changing to `unsigned` types where applicable, sometimes `signed` types, and casting as a last resort. Change-Id: I08895543ffb7a48058bcf91ef6500ca113f2d305 Signed-off-by: Nico Huber <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/c/flashrom/+/30409 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Jacob Garber <jgarber1@ualberta.ca>
Diffstat (limited to 'dmi.c')
-rw-r--r--dmi.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/dmi.c b/dmi.c
index ae90f7c4e..9ec935a61 100644
--- a/dmi.c
+++ b/dmi.c
@@ -147,7 +147,7 @@ static char *dmi_string(const char *buf, uint8_t string_id, const char *limit)
static void dmi_chassis_type(uint8_t code)
{
- int i;
+ unsigned int i;
code &= 0x7f; /* bits 6:0 are chassis type, 7th bit is the lock bit */
is_laptop = 2;
for (i = 0; i < ARRAY_SIZE(dmi_chassis_types); i++) {
@@ -161,7 +161,7 @@ static void dmi_chassis_type(uint8_t code)
static void dmi_table(uint32_t base, uint16_t len, uint16_t num)
{
- int i = 0, j = 0;
+ unsigned int i = 0, j = 0;
uint8_t *dmi_table_mem = physmap_ro("DMI Table", base, len);
if (dmi_table_mem == NULL) {
@@ -346,7 +346,7 @@ static char *get_dmi_string(const char *string_name)
static int dmi_fill(void)
{
- int i;
+ unsigned int i;
char *chassis_type;
msg_pdbg("Using External DMI decoder.\n");
@@ -376,7 +376,7 @@ static int dmi_fill(void)
static int dmi_shutdown(void *data)
{
- int i;
+ unsigned int i;
for (i = 0; i < ARRAY_SIZE(dmi_strings); i++) {
free(dmi_strings[i].value);
dmi_strings[i].value = NULL;
@@ -406,7 +406,7 @@ void dmi_init(void)
}
has_dmi_support = 1;
- int i;
+ unsigned int i;
for (i = 0; i < ARRAY_SIZE(dmi_strings); i++) {
msg_pdbg("DMI string %s: \"%s\"\n", dmi_strings[i].keyword,
(dmi_strings[i].value == NULL) ? "" : dmi_strings[i].value);
@@ -463,7 +463,7 @@ static int dmi_compare(const char *value, const char *pattern)
int dmi_match(const char *pattern)
{
- int i;
+ unsigned int i;
if (!has_dmi_support)
return 0;