From 7c22ece8e476dcaff69ef4e89259f4ab2242b25e Mon Sep 17 00:00:00 2001 From: Yiwei Zhang Date: Tue, 28 Sep 2021 04:45:03 +0000 Subject: [PATCH] util: fix sign comparison MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yiwei Zhang Reviewed-by: Marek Olšák Reviewed-by: Ryan Neph Part-of: --- src/util/u_cpu_detect.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/util/u_cpu_detect.c b/src/util/u_cpu_detect.c index ae711aae14f..955d087b8ea 100644 --- a/src/util/u_cpu_detect.c +++ b/src/util/u_cpu_detect.c @@ -497,8 +497,7 @@ get_cpu_topology(void) * * Loop over all possible CPUs even though some may be offline. */ - for (unsigned i = 0; i < util_cpu_caps.max_cpus && i < UTIL_MAX_CPUS; - i++) { + for (int16_t i = 0; i < util_cpu_caps.max_cpus && i < UTIL_MAX_CPUS; i++) { uint32_t cpu_bit = 1u << (i % 32); mask[i / 32] = cpu_bit;