* [PATCH] selftests: kselftest: fix function return type
@ 2019-05-24 1:20 ` alakesh.haloi
0 siblings, 0 replies; 3+ messages in thread
From: Alakesh Haloi @ 2019-05-24 1:20 UTC (permalink / raw)
To: Shuah Khan; +Cc: linux-kselftest, linux-kernel
ksft_test_num function returns sum of unsigned ints and hence should
return unsigned int. This fixes the following compiler warning
In file included from sync_test.c:37:0:
../kselftest.h: In function ‘ksft_print_cnts’:
../kselftest.h:73:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (ksft_plan != ksft_test_num())
^~
Signed-off-by: Alakesh Haloi <alakesh.haloi@gmail.com>
---
tools/testing/selftests/kselftest.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/kselftest.h b/tools/testing/selftests/kselftest.h
index ec15c4f6af55..5a98c80e079e 100644
--- a/tools/testing/selftests/kselftest.h
+++ b/tools/testing/selftests/kselftest.h
@@ -35,7 +35,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 +
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] selftests: kselftest: fix function return type
@ 2019-05-24 1:20 ` alakesh.haloi
0 siblings, 0 replies; 3+ messages in thread
From: alakesh.haloi @ 2019-05-24 1:20 UTC (permalink / raw)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1058 bytes --]
ksft_test_num function returns sum of unsigned ints and hence should
return unsigned int. This fixes the following compiler warning
In file included from sync_test.c:37:0:
../kselftest.h: In function ‘ksft_print_cnts’:
../kselftest.h:73:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (ksft_plan != ksft_test_num())
^~
Signed-off-by: Alakesh Haloi <alakesh.haloi at gmail.com>
---
tools/testing/selftests/kselftest.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/kselftest.h b/tools/testing/selftests/kselftest.h
index ec15c4f6af55..5a98c80e079e 100644
--- a/tools/testing/selftests/kselftest.h
+++ b/tools/testing/selftests/kselftest.h
@@ -35,7 +35,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 +
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] selftests: kselftest: fix function return type
@ 2019-05-24 1:20 ` alakesh.haloi
0 siblings, 0 replies; 3+ messages in thread
From: Alakesh Haloi @ 2019-05-24 1:20 UTC (permalink / raw)
ksft_test_num function returns sum of unsigned ints and hence should
return unsigned int. This fixes the following compiler warning
In file included from sync_test.c:37:0:
../kselftest.h: In function ‘ksft_print_cnts’:
../kselftest.h:73:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (ksft_plan != ksft_test_num())
^~
Signed-off-by: Alakesh Haloi <alakesh.haloi at gmail.com>
---
tools/testing/selftests/kselftest.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/kselftest.h b/tools/testing/selftests/kselftest.h
index ec15c4f6af55..5a98c80e079e 100644
--- a/tools/testing/selftests/kselftest.h
+++ b/tools/testing/selftests/kselftest.h
@@ -35,7 +35,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 +
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-05-24 1:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-24 1:20 [PATCH] selftests: kselftest: fix function return type Alakesh Haloi
2019-05-24 1:20 ` Alakesh Haloi
2019-05-24 1:20 ` alakesh.haloi
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.