diff mbox series

[07/16] selftests/mm: hmm-tests: Remove always false expressions

Message ID 20250109173842.1142376-8-usama.anjum@collabora.com (mailing list archive)
State New
Headers show
Series selftest/mm: Remove warnings found by adding compiler flags | expand

Commit Message

Muhammad Usama Anjum Jan. 9, 2025, 5:38 p.m. UTC
As default_hsize is unsigned, it is always greater than equal to zero.
Remove expression which is checking if it is less than 0.

Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
---
 tools/testing/selftests/mm/hmm-tests.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/tools/testing/selftests/mm/hmm-tests.c b/tools/testing/selftests/mm/hmm-tests.c
index 141bf63cbe05e..3b4db583bd3b6 100644
--- a/tools/testing/selftests/mm/hmm-tests.c
+++ b/tools/testing/selftests/mm/hmm-tests.c
@@ -796,7 +796,7 @@  TEST_F(hmm, anon_write_hugetlbfs)
 	int ret;
 
 	default_hsize = file_read_ulong("/proc/meminfo", "Hugepagesize:");
-	if (default_hsize < 0 || default_hsize*1024 < default_hsize)
+	if (default_hsize*1024 < default_hsize)
 		SKIP(return, "Huge page size could not be determined");
 	default_hsize = default_hsize*1024; /* KB to B */
 
@@ -1579,7 +1579,7 @@  TEST_F(hmm, compound)
 	/* Skip test if we can't allocate a hugetlbfs page. */
 
 	default_hsize = file_read_ulong("/proc/meminfo", "Hugepagesize:");
-	if (default_hsize < 0 || default_hsize*1024 < default_hsize)
+	if (default_hsize*1024 < default_hsize)
 		SKIP(return, "Huge page size could not be determined");
 	default_hsize = default_hsize*1024; /* KB to B */