From: Muhammad Usama Anjum <usama.anjum@collabora.com>
To: "Kees Cook" <kees@kernel.org>,
"Andy Lutomirski" <luto@amacapital.net>,
"Will Drewry" <wad@chromium.org>, "Shuah Khan" <shuah@kernel.org>,
"Andrew Morton" <akpm@linux-foundation.org>,
"Jérôme Glisse" <jglisse@redhat.com>,
linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-mm@kvack.org
Cc: Muhammad Usama Anjum <usama.anjum@collabora.com>, kernel@collabora.com
Subject: [PATCH 15/16] selftests/mm: uffd-*: Fix all type mismatch warnings
Date: Thu, 9 Jan 2025 22:38:41 +0500 [thread overview]
Message-ID: <20250109173842.1142376-16-usama.anjum@collabora.com> (raw)
In-Reply-To: <20250109173842.1142376-1-usama.anjum@collabora.com>
Fix all type mismatch warnings in all uffd-* files.
Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
---
tools/testing/selftests/mm/uffd-common.c | 6 +++---
tools/testing/selftests/mm/uffd-stress.c | 2 +-
tools/testing/selftests/mm/uffd-unit-tests.c | 6 +++---
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/tools/testing/selftests/mm/uffd-common.c b/tools/testing/selftests/mm/uffd-common.c
index c15674a60f299..47bdcb47481ae 100644
--- a/tools/testing/selftests/mm/uffd-common.c
+++ b/tools/testing/selftests/mm/uffd-common.c
@@ -450,7 +450,7 @@ void uffd_handle_page_fault(struct uffd_msg *msg, struct uffd_args *args)
args->wp_faults++;
} else if (msg->arg.pagefault.flags & UFFD_PAGEFAULT_FLAG_MINOR) {
uint8_t *area;
- int b;
+ unsigned int b;
/*
* Minor page faults
@@ -621,7 +621,7 @@ int __copy_page(int ufd, unsigned long offset, bool retry, bool wp)
err("UFFDIO_COPY error: %"PRId64,
(int64_t)uffdio_copy.copy);
wake_range(ufd, uffdio_copy.dst, page_size);
- } else if (uffdio_copy.copy != page_size) {
+ } else if (uffdio_copy.copy != (signed long)page_size) {
err("UFFDIO_COPY error: %"PRId64, (int64_t)uffdio_copy.copy);
} else {
if (test_uffdio_copy_eexist && retry) {
@@ -655,7 +655,7 @@ int move_page(int ufd, unsigned long offset, unsigned long len)
err("UFFDIO_MOVE error: %"PRId64,
(int64_t)uffdio_move.move);
wake_range(ufd, uffdio_move.dst, len);
- } else if (uffdio_move.move != len) {
+ } else if (uffdio_move.move != (signed long)len) {
err("UFFDIO_MOVE error: %"PRId64, (int64_t)uffdio_move.move);
} else
return 1;
diff --git a/tools/testing/selftests/mm/uffd-stress.c b/tools/testing/selftests/mm/uffd-stress.c
index 1270ff3104cc6..5509ec32c3290 100644
--- a/tools/testing/selftests/mm/uffd-stress.c
+++ b/tools/testing/selftests/mm/uffd-stress.c
@@ -77,7 +77,7 @@ static void usage(void)
static void uffd_stats_reset(struct uffd_args *args, unsigned long n_cpus)
{
- int i;
+ unsigned int i;
for (i = 0; i < n_cpus; i++) {
args[i].cpu = i;
diff --git a/tools/testing/selftests/mm/uffd-unit-tests.c b/tools/testing/selftests/mm/uffd-unit-tests.c
index 81b315bedb744..c3d59ec754040 100644
--- a/tools/testing/selftests/mm/uffd-unit-tests.c
+++ b/tools/testing/selftests/mm/uffd-unit-tests.c
@@ -917,7 +917,7 @@ static bool do_uffdio_zeropage(int ufd, bool has_zeropage)
else if (res != -EINVAL)
err("UFFDIO_ZEROPAGE not -EINVAL");
} else if (has_zeropage) {
- if (res != page_size)
+ if (res != (signed long)page_size)
err("UFFDIO_ZEROPAGE unexpected size");
else
retry_uffdio_zeropage(ufd, &uffdio_zeropage);
@@ -949,7 +949,7 @@ uffd_register_detect_zeropage(int uffd, void *addr, uint64_t len)
static void uffd_zeropage_test(uffd_test_args_t __attribute__((unused)) *args)
{
bool has_zeropage;
- int i;
+ unsigned int i;
has_zeropage = uffd_register_detect_zeropage(uffd, area_dst, page_size);
if (area_dst_alias)
@@ -997,7 +997,7 @@ static void do_uffdio_poison(int uffd, unsigned long offset)
if (ret)
err("UFFDIO_POISON error: %"PRId64, (int64_t)res);
- else if (res != page_size)
+ else if (res != (signed long)page_size)
err("UFFDIO_POISON unexpected size: %"PRId64, (int64_t)res);
}
--
2.39.5
next prev parent reply other threads:[~2025-01-09 17:40 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-09 17:38 [PATCH 00/16] selftest/mm: Remove warnings found by adding compiler flags Muhammad Usama Anjum
2025-01-09 17:38 ` [PATCH 01/16] selftests/mm: remove argc and argv unused parameters Muhammad Usama Anjum
2025-01-09 17:42 ` Kees Cook
2025-01-09 17:48 ` Muhammad Usama Anjum
2025-01-09 17:50 ` Kees Cook
2025-01-10 0:12 ` Andrew Morton
2025-02-01 7:43 ` Muhammad Usama Anjum
2025-01-10 19:00 ` David Laight
2025-02-01 7:32 ` Muhammad Usama Anjum
2025-01-09 17:38 ` [PATCH 02/16] selftests/mm: Fix unused parameter warnings Muhammad Usama Anjum
2025-01-09 17:38 ` [PATCH 03/16] " Muhammad Usama Anjum
2025-01-09 17:38 ` [PATCH 04/16] selftests/mm: Fix type mismatch warnings Muhammad Usama Anjum
2025-01-09 17:38 ` [PATCH 05/16] selftests/mm: kselftest_harness: Fix warnings Muhammad Usama Anjum
2025-01-15 22:19 ` Mark Brown
2025-01-09 17:38 ` [PATCH 06/16] selftests/mm: cow: remove unused variables and fix type mismatch errors Muhammad Usama Anjum
2025-01-09 17:38 ` [PATCH 07/16] selftests/mm: hmm-tests: Remove always false expressions Muhammad Usama Anjum
2025-01-09 17:38 ` [PATCH 08/16] selftests/mm: guard-pages: Fix type mismatch warnings Muhammad Usama Anjum
2025-01-09 17:38 ` [PATCH 09/16] selftests/mm: hugetlb-madvise: fix type mismatch issues Muhammad Usama Anjum
2025-01-09 17:38 ` [PATCH 10/16] selftests/mm: hugepage-vmemmap: fix type mismatch warnings Muhammad Usama Anjum
2025-01-09 17:38 ` [PATCH 11/16] selftests/mm: hugetlb-read-hwpoison: Fix " Muhammad Usama Anjum
2025-01-09 17:38 ` [PATCH 12/16] selftests/mm: khugepaged: " Muhammad Usama Anjum
2025-01-09 17:38 ` [PATCH 13/16] selftests/mm: protection_keys: Fix variables types " Muhammad Usama Anjum
2025-01-09 17:38 ` [PATCH 14/16] selftests/mm: thuge-gen: Fix type " Muhammad Usama Anjum
2025-01-09 17:38 ` Muhammad Usama Anjum [this message]
2025-01-09 17:38 ` [PATCH 16/16] selftests/mm: Makefile: Add the compiler flags Muhammad Usama Anjum
2025-01-16 5:32 ` [PATCH 00/16] selftest/mm: Remove warnings found by adding " Andrew Morton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250109173842.1142376-16-usama.anjum@collabora.com \
--to=usama.anjum@collabora.com \
--cc=akpm@linux-foundation.org \
--cc=jglisse@redhat.com \
--cc=kees@kernel.org \
--cc=kernel@collabora.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=luto@amacapital.net \
--cc=shuah@kernel.org \
--cc=wad@chromium.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox