Skip to contentSkip to conversation

kselftest: ksft_test_num return type should be unsigned

PATCH New Paolo Bonzini 1 participant 1 message Jun 23, 2020 Kselftest

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kselftest: ksft_test_num return type should be unsigned

Fixes a compiler warning:

In file included from sync_test.c:37:
../kselftest.h: In function ‘ksft_print_cnts’:
../kselftest.h:78:16: warning: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘int’ [-Wsign-compare]
if (ksft_plan != ksft_test_num())

                ^~
---
 tools/testing/selftests/kselftest.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/kselftest.h +1 -1
index 0ac49d91a260..862eee734553 100644
@@ -36,7 +36,7 @@ struct ksft_count {
 static struct ksft_count ksft_cnt;
 static unsigned int ksft_plan;
 
-static inline int ksft_test_num(void)
+static inline unsigned int ksft_test_num(void)
 {
 	return ksft_cnt.ksft_pass + ksft_cnt.ksft_fail +
 		ksft_cnt.ksft_xfail + ksft_cnt.ksft_xpass +
Signature · 1 line
2.26.2