From a711e9c44dfc0c50dd1a05a8cf34d393093300b4 Mon Sep 17 00:00:00 2001 From: Jacob Garber Date: Fri, 28 Jun 2019 10:58:56 -0600 Subject: payloads/coreinfo: Use correct integer types for loop indices Make sure that the type of the loop index matches the type of the upper bound. This fixes several -Wsign-compare warnings. Change-Id: I73a88355d86288609e03f7a6fcaec14dfedac203 Signed-off-by: Jacob Garber Reviewed-on: https://review.coreboot.org/c/coreboot/+/33863 Tested-by: build bot (Jenkins) Reviewed-by: HAOUAS Elyes --- payloads/coreinfo/timestamps_module.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'payloads/coreinfo/timestamps_module.c') diff --git a/payloads/coreinfo/timestamps_module.c b/payloads/coreinfo/timestamps_module.c index fe2d2b5c6b..5468844f89 100644 --- a/payloads/coreinfo/timestamps_module.c +++ b/payloads/coreinfo/timestamps_module.c @@ -29,9 +29,7 @@ static unsigned long tick_freq_mhz; static const char *timestamp_name(uint32_t id) { - int i; - - for (i = 0; i < ARRAY_SIZE(timestamp_ids); i++) { + for (size_t i = 0; i < ARRAY_SIZE(timestamp_ids); i++) { if (timestamp_ids[i].id == id) return timestamp_ids[i].name; } @@ -184,7 +182,7 @@ static int timestamps_module_init(void) prev_stamp = base_time; total_time = 0; - for (int i = 0; i < n_entries; i++) { + for (u32 i = 0; i < n_entries; i++) { uint64_t stamp; const struct timestamp_entry *tse = ×tamps->entries[i]; -- cgit v1.2.3