Skip to content

Commit 380969f

Browse files
davidhildenbrandakpm00
authored andcommitted
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/[email protected] Fixes: 6f1405e ("selftests/vm: anon_cow: add R/O longterm tests via gup_test") Signed-off-by: David Hildenbrand <[email protected]> Cc: Shuah Khan <[email protected]> Cc: Yang Li <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent d88825f commit 380969f

File tree

1 file changed

+2
-2
lines changed
  • tools/testing/selftests/vm

1 file changed

+2
-2
lines changed

tools/testing/selftests/vm/cow.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,7 @@ static void do_test_ro_pin(char *mem, size_t size, enum ro_pin_test test,
650650
}
651651

652652
/* Take a R/O pin. This should trigger unsharing. */
653-
args.addr = (__u64)mem;
653+
args.addr = (__u64)(uintptr_t)mem;
654654
args.size = size;
655655
args.flags = fast ? PIN_LONGTERM_TEST_FLAG_USE_FAST : 0;
656656
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,
669669
* Read back the content via the pin to the temporary buffer and
670670
* test if we observed the modification.
671671
*/
672-
tmp_val = (__u64)tmp;
672+
tmp_val = (__u64)(uintptr_t)tmp;
673673
ret = ioctl(gup_fd, PIN_LONGTERM_TEST_READ, &tmp_val);
674674
if (ret)
675675
ksft_test_result_fail("PIN_LONGTERM_TEST_READ failed\n");

0 commit comments

Comments
 (0)