From 45e13ffc12f8e036dbb25672712437a050584e37 Mon Sep 17 00:00:00 2001 From: Shoukui Zhang Date: Thu, 28 Mar 2024 11:01:52 +0800 Subject: [PATCH] Fix greater-than-or-equal-to-zero issue unsigned_compare: This greater-than-or-equal-to-zero comparison without a signed value is always true. ndx >= 0U Signed-off-by: Shoukui Zhang --- libs/libc/tls/tls_cleanup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/libc/tls/tls_cleanup.c b/libs/libc/tls/tls_cleanup.c index acf52affe2961..5ee7bbaa8abf3 100644 --- a/libs/libc/tls/tls_cleanup.c +++ b/libs/libc/tls/tls_cleanup.c @@ -62,7 +62,7 @@ void tls_cleanup_pop(FAR struct tls_info_s *tls, int execute) /* Get the index to the last cleaner function pushed onto the stack */ ndx = tls->tl_tos - 1; - DEBUGASSERT(ndx >= 0 && ndx < CONFIG_TLS_NCLEANUP); + DEBUGASSERT(ndx < CONFIG_TLS_NCLEANUP); /* Should we execute the cleanup routine at the top of the stack? */