diff mbox series

[14/16] selftests/mm: thuge-gen: Fix type mismatch warnings

Message ID 20250109173842.1142376-15-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
Fix all the found type mismatch warnings.

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

Patch

diff --git a/tools/testing/selftests/mm/thuge-gen.c b/tools/testing/selftests/mm/thuge-gen.c
index e4370b79b62ff..515b89ac4eb59 100644
--- a/tools/testing/selftests/mm/thuge-gen.c
+++ b/tools/testing/selftests/mm/thuge-gen.c
@@ -65,7 +65,7 @@  void show(unsigned long ps)
 {
 	char buf[100];
 
-	if (ps == getpagesize())
+	if ((signed long)ps == getpagesize())
 		return;
 
 	ksft_print_msg("%luMB: ", ps >> 20);
@@ -106,7 +106,7 @@  unsigned long read_sysfs(int warn, char *fmt, ...)
 
 unsigned long read_free(unsigned long ps)
 {
-	return read_sysfs(ps != getpagesize(),
+	return read_sysfs((signed long)ps != getpagesize(),
 			  "/sys/kernel/mm/hugepages/hugepages-%lukB/free_hugepages",
 			  ps >> 10);
 }
@@ -126,7 +126,7 @@  void test_mmap(unsigned long size, unsigned flags)
 	after = read_free(size);
 
 	show(size);
-	ksft_test_result(size == getpagesize() || (before - after) == NUM_PAGES,
+	ksft_test_result((signed long)size == getpagesize() || (before - after) == NUM_PAGES,
 			 "%s mmap\n", __func__);
 
 	if (munmap(map, size * NUM_PAGES))
@@ -164,7 +164,7 @@  void test_shmget(unsigned long size, unsigned flags)
 	after = read_free(size);
 
 	show(size);
-	ksft_test_result(size == getpagesize() || (before - after) == NUM_PAGES,
+	ksft_test_result((signed long)size == getpagesize() || (before - after) == NUM_PAGES,
 			 "%s: mmap\n", __func__);
 	if (shmdt(map))
 		ksft_exit_fail_msg("%s: shmdt: %s\n", __func__, strerror(errno));
@@ -173,7 +173,7 @@  void test_shmget(unsigned long size, unsigned flags)
 void find_pagesizes(void)
 {
 	unsigned long largest = getpagesize();
-	int i;
+	unsigned int i;
 	glob_t g;
 
 	glob("/sys/kernel/mm/hugepages/hugepages-*kB", 0, NULL, &g);