diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2017-01-02 11:23:33 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2017-01-02 11:24:23 +0000 |
commit | 8f39310fa7484829f0899860b1677a0f75898edf (patch) | |
tree | 0f43fa939f255d831ab017c0f7ec7bbee5960d47 /tests | |
parent | 39858a1e752f8f26250171e8658388f0853c176c (diff) |
lib: Wrap conversion from u64 to pointers
The opposite direction of to_user_pointer() is from_user_pointer().
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/gem_concurrent_all.c | 4 | ||||
-rw-r--r-- | tests/gem_mmap.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/tests/gem_concurrent_all.c b/tests/gem_concurrent_all.c index 2ebd30ab..66250849 100644 --- a/tests/gem_concurrent_all.c +++ b/tests/gem_concurrent_all.c @@ -243,7 +243,7 @@ static void create_userptr_require(const struct create *create, unsigned count) has_userptr = drmIoctl(fd, LOCAL_IOCTL_I915_GEM_USERPTR, &arg) == 0; - free((void *)(uintptr_t)arg.user_ptr); + free(from_user_pointer(arg.user_ptr)); } } @@ -275,7 +275,7 @@ userptr_create_bo(const struct buffers *b) userptr.user_size, 0); igt_assert(bo); #endif - bo->virtual = (void *)(uintptr_t)userptr.user_ptr; + bo->virtual = from_user_pointer(userptr.user_ptr); return bo; } diff --git a/tests/gem_mmap.c b/tests/gem_mmap.c index 2e0d725f..0ed15878 100644 --- a/tests/gem_mmap.c +++ b/tests/gem_mmap.c @@ -142,7 +142,7 @@ igt_main arg.size = OBJECT_SIZE; ret = ioctl(fd, DRM_IOCTL_I915_GEM_MMAP, &arg); igt_assert(ret == 0); - addr = (uint8_t *)(uintptr_t)arg.addr_ptr; + addr = from_user_pointer(arg.addr_ptr); igt_info("Testing contents of newly created object.\n"); memset(expected, 0, sizeof(expected)); |