From 68d5516c9012bb5c622a3c32cfd1435286e6d748 Mon Sep 17 00:00:00 2001 From: wangjianyu3 Date: Sun, 24 Dec 2023 15:50:06 +0800 Subject: [PATCH] Thermal/dummy: Fix warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ``` CID 1159822: (#1 of 2): 宏将无符号值与 0 做了比较 (NO_EFFECT) unsigned_compare: 不带符号值的此 greater-than-or-equal-to-zero 比较总是为 true。index >= 0U。 ``` Signed-off-by: wangjianyu3 --- drivers/thermal/thermal_dummy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/thermal/thermal_dummy.c b/drivers/thermal/thermal_dummy.c index fa45968b9c079..7765a052a7ffc 100644 --- a/drivers/thermal/thermal_dummy.c +++ b/drivers/thermal/thermal_dummy.c @@ -281,7 +281,7 @@ static int dummy_cpufreq_target_index(FAR struct cpufreq_policy *driver, FAR struct dummy_cpufreq_driver_s **dummy = (FAR struct dummy_cpufreq_driver_s **)driver; - DEBUGASSERT(index >= 0 && index < (*dummy)->table_len); + DEBUGASSERT(index < (*dummy)->table_len); (*dummy)->current = (*dummy)->table[index].frequency; return 0;