aboutsummaryrefslogtreecommitdiff
path: root/payloads/coreinfo/timestamps_module.c
diff options
context:
space:
mode:
authorJacob Garber <jgarber1@ualberta.ca>2019-06-28 10:58:56 -0600
committerMartin Roth <martinroth@google.com>2019-07-07 20:19:49 +0000
commita711e9c44dfc0c50dd1a05a8cf34d393093300b4 (patch)
treef32d68a7e1cf549bbf0ad919fc63826afb94d652 /payloads/coreinfo/timestamps_module.c
parent37bec0b3971efa18f6fcc405edfb4272d215752d (diff)
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 <jgarber1@ualberta.ca> Reviewed-on: https://review.coreboot.org/c/coreboot/+/33863 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
Diffstat (limited to 'payloads/coreinfo/timestamps_module.c')
-rw-r--r--payloads/coreinfo/timestamps_module.c6
1 files changed, 2 insertions, 4 deletions
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 = &timestamps->entries[i];