summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/vm
diff options
context:
space:
mode:
authorDavid Hildenbrand <david@redhat.com>2022-12-05 20:37:15 +0100
committerAndrew Morton <akpm@linux-foundation.org>2022-12-11 18:12:20 -0800
commit380969fe5aacdea661d3f9ab32e84327e8624ae2 (patch)
tree1bcc658b5ad64a5e5eb4cce63603edfe95e57704 /tools/testing/selftests/vm
parentd88825f22b8f1cad8acb429b6bf0a54c85d7b93f (diff)
selftests/vm: cow: fix compile warning on 32bit
The compiler complains about the conversion of a pointer to an int of different width. Link: https://lkml.kernel.org/r/20221205193716.276024-4-david@redhat.com Fixes: 6f1405efc61b ("selftests/vm: anon_cow: add R/O longterm tests via gup_test") Signed-off-by: David Hildenbrand <david@redhat.com> Cc: Shuah Khan <shuah@kernel.org> Cc: Yang Li <yang.lee@linux.alibaba.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'tools/testing/selftests/vm')
-rw-r--r--tools/testing/selftests/vm/cow.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/testing/selftests/vm/cow.c b/tools/testing/selftests/vm/cow.c
index 73e05b52c49e..26f6ea3079e2 100644
--- a/tools/testing/selftests/vm/cow.c
+++ b/tools/testing/selftests/vm/cow.c
@@ -650,7 +650,7 @@ static void do_test_ro_pin(char *mem, size_t size, enum ro_pin_test test,
}
/* Take a R/O pin. This should trigger unsharing. */
- args.addr = (__u64)mem;
+ args.addr = (__u64)(uintptr_t)mem;
args.size = size;
args.flags = fast ? PIN_LONGTERM_TEST_FLAG_USE_FAST : 0;
ret = ioctl(gup_fd, PIN_LONGTERM_TEST_START, &args);
@@ -669,7 +669,7 @@ static void do_test_ro_pin(char *mem, size_t size, enum ro_pin_test test,
* Read back the content via the pin to the temporary buffer and
* test if we observed the modification.
*/
- tmp_val = (__u64)tmp;
+ tmp_val = (__u64)(uintptr_t)tmp;
ret = ioctl(gup_fd, PIN_LONGTERM_TEST_READ, &tmp_val);
if (ret)
ksft_test_result_fail("PIN_LONGTERM_TEST_READ failed\n");