The patch titled Subject: selftests/mm: khugepaged: fix type mismatch warnings has been added to the -mm mm-unstable branch. Its filename is selftests-mm-khugepaged-fix-type-mismatch-warnings.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/selftests-mm-khugepaged-fix-type-mismatch-warnings.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Muhammad Usama Anjum <usama.anjum@xxxxxxxxxxxxx> Subject: selftests/mm: khugepaged: fix type mismatch warnings Date: Thu, 9 Jan 2025 22:38:38 +0500 Fix type mismatch warnings. Link: https://lkml.kernel.org/r/20250109173842.1142376-13-usama.anjum@xxxxxxxxxxxxx Signed-off-by: Muhammad Usama Anjum <usama.anjum@xxxxxxxxxxxxx> Cc: Andy Lutomirski <luto@xxxxxxxxxxxxxx> Cc: Jérôme Glisse <jglisse@xxxxxxxxxx> Cc: Kees Cook <kees@xxxxxxxxxx> Cc: Shuah Khan <shuah@xxxxxxxxxx> Cc: Will Drewry <wad@xxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- tools/testing/selftests/mm/khugepaged.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) --- a/tools/testing/selftests/mm/khugepaged.c~selftests-mm-khugepaged-fix-type-mismatch-warnings +++ a/tools/testing/selftests/mm/khugepaged.c @@ -140,7 +140,7 @@ static void get_finfo(const char *dir) exit(EXIT_FAILURE); } if (snprintf(finfo.path, sizeof(finfo.path), "%s/" TEST_FILE, - finfo.dir) >= sizeof(finfo.path)) { + finfo.dir) >= (signed int)sizeof(finfo.path)) { printf("%s: Pathname is too long\n", __func__); exit(EXIT_FAILURE); } @@ -155,7 +155,7 @@ static void get_finfo(const char *dir) /* Find owning device's queue/read_ahead_kb control */ if (snprintf(path, sizeof(path), "/sys/dev/block/%d:%d/uevent", major(path_stat.st_dev), minor(path_stat.st_dev)) - >= sizeof(path)) { + >= (signed int)sizeof(path)) { printf("%s: Pathname is too long\n", __func__); exit(EXIT_FAILURE); } @@ -169,7 +169,7 @@ static void get_finfo(const char *dir) sizeof(finfo.dev_queue_read_ahead_path), "/sys/dev/block/%d:%d/queue/read_ahead_kb", major(path_stat.st_dev), minor(path_stat.st_dev)) - >= sizeof(finfo.dev_queue_read_ahead_path)) { + >= (signed int)sizeof(finfo.dev_queue_read_ahead_path)) { printf("%s: Pathname is too long\n", __func__); exit(EXIT_FAILURE); } @@ -197,7 +197,7 @@ static void get_finfo(const char *dir) if (snprintf(finfo.dev_queue_read_ahead_path, sizeof(finfo.dev_queue_read_ahead_path), "/sys/block/%s/queue/read_ahead_kb", - str) >= sizeof(finfo.dev_queue_read_ahead_path)) { + str) >= (signed int)sizeof(finfo.dev_queue_read_ahead_path)) { printf("%s: Pathname is too long\n", __func__); exit(EXIT_FAILURE); } @@ -271,7 +271,7 @@ static void *alloc_mapping(int nr) static void fill_memory(int *p, unsigned long start, unsigned long end) { - int i; + unsigned int i; for (i = start / page_size; i < end / page_size; i++) p[i * page_size / sizeof(*p)] = i + 0xdead0000; @@ -333,10 +333,10 @@ static void *alloc_hpage(struct mem_ops static void validate_memory(int *p, unsigned long start, unsigned long end) { - int i; + unsigned int i; for (i = start / page_size; i < end / page_size; i++) { - if (p[i * page_size / sizeof(*p)] != i + 0xdead0000) { + if ((unsigned int)p[i * page_size / sizeof(*p)] != i + 0xdead0000) { printf("Page %d is corrupted: %#x\n", i, p[i * page_size / sizeof(*p)]); exit(EXIT_FAILURE); @@ -537,7 +537,7 @@ static void madvise_collapse(const char static bool wait_for_scan(const char *msg, char *p, int nr_hpages, struct mem_ops *ops) { - int full_scans; + unsigned int full_scans; int timeout = 6; /* 3 seconds */ /* Sanity check */ _ Patches currently in -mm which might be from usama.anjum@xxxxxxxxxxxxx are selftests-mm-thp_settings-remove-const-from-return-type.patch selftests-mm-pagemap_ioctl-fix-types-mismatches-shown-by-compiler-options.patch selftests-mm-mseal_test-remove-unused-variables.patch selftests-mm-mremap_test-remove-unused-variable-and-type-mismatches.patch selftests-mm-remove-argc-and-argv-unused-parameters.patch selftests-mm-fix-unused-parameter-warnings.patch selftests-mm-fix-type-mismatch-warnings.patch selftests-mm-kselftest_harness-fix-warnings.patch selftests-mm-cow-remove-unused-variables-and-fix-type-mismatch-errors.patch selftests-mm-hmm-tests-remove-always-false-expressions.patch selftests-mm-guard-pages-fix-type-mismatch-warnings.patch selftests-mm-hugetlb-madvise-fix-type-mismatch-issues.patch selftests-mm-hugepage-vmemmap-fix-type-mismatch-warnings.patch selftests-mm-hugetlb-read-hwpoison-fix-type-mismatch-warnings.patch selftests-mm-khugepaged-fix-type-mismatch-warnings.patch selftests-mm-protection_keys-fix-variables-types-mismatch-warnings.patch selftests-mm-thuge-gen-fix-type-mismatch-warnings.patch selftests-mm-uffd-fix-all-type-mismatch-warnings.patch selftests-mm-makefile-add-the-compiler-flags.patch