diff mbox series

[09/16] selftests/mm: hugetlb-madvise: fix type mismatch issues

Message ID 20250109173842.1142376-10-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 type mismatch warnings:
  hugetlb-madvise.c:30:25: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare]
     30 |                 if (fhp != (exp_free)) {                                \
        |                         ^~
  hugetlb-madvise.c:114:9: note: in expansion of macro ‘validate_free_pages’
    114 |         validate_free_pages(free_hugepages - NR_HUGE_PAGES);
        |         ^~~~~~~~~~~~~~~~~~~

Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
---
 tools/testing/selftests/mm/hugetlb-madvise.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/tools/testing/selftests/mm/hugetlb-madvise.c b/tools/testing/selftests/mm/hugetlb-madvise.c
index 43f16c12c8e9a..8f527084858d0 100644
--- a/tools/testing/selftests/mm/hugetlb-madvise.c
+++ b/tools/testing/selftests/mm/hugetlb-madvise.c
@@ -26,7 +26,7 @@ 
 
 #define validate_free_pages(exp_free)					\
 	do {								\
-		int fhp = get_free_hugepages();				\
+		unsigned int fhp = get_free_hugepages();		\
 		if (fhp != (exp_free)) {				\
 			printf("Unexpected number of free huge "	\
 				"pages line %d\n", __LINE__);		\