From f52e7ec7876603b4edb0bff412255f8f1624ecc4 Mon Sep 17 00:00:00 2001 From: Ville Syrjälä Date: Fri, 9 Oct 2015 19:11:39 +0300 Subject: Replace __gem_mmap__{cpu,gtt,wc}() + igt_assert() with gem_mmap__{cpu,gtt,wc}() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gem_mmap__{cpu,gtt,wc}() already has the assert built in, so replace __gem_mmap__{cpu,gtt,wc}() + igt_assert() with it. Mostly done with coccinelle, with some manual help: @@ identifier I; expression E1, E2, E3, E4, E5, E6; @@ ( - I = __gem_mmap__gtt(E1, E2, E3, E4); + I = gem_mmap__gtt(E1, E2, E3, E4); ... - igt_assert(I); | - I = __gem_mmap__cpu(E1, E2, E3, E4, E5); + I = gem_mmap__cpu(E1, E2, E3, E4, E5); ... - igt_assert(I); | - I = __gem_mmap__wc(E1, E2, E3, E4, E5); + I = gem_mmap__wc(E1, E2, E3, E4, E5); ... - igt_assert(I); ) Signed-off-by: Ville Syrjälä Stochastically-reviwewed-by: Chris Wilson --- tests/gem_tiled_swapping.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'tests/gem_tiled_swapping.c') diff --git a/tests/gem_tiled_swapping.c b/tests/gem_tiled_swapping.c index 730e625c..f45244b5 100644 --- a/tests/gem_tiled_swapping.c +++ b/tests/gem_tiled_swapping.c @@ -94,8 +94,8 @@ fill_bo(int fd, uint32_t handle) uint32_t *data; int i; - data = __gem_mmap__gtt(fd, handle, LINEAR_DWORDS, PROT_READ | PROT_WRITE); - igt_assert(data); + data = gem_mmap__gtt(fd, handle, LINEAR_DWORDS, + PROT_READ | PROT_WRITE); gem_set_domain(fd, handle, I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT); for (i = 0; i < WIDTH*HEIGHT; i++) @@ -109,8 +109,7 @@ check_bo(int fd, uint32_t handle) uint32_t *data; int j; - data = __gem_mmap__gtt(fd, handle, LINEAR_DWORDS, PROT_READ); - igt_assert(data); + data = gem_mmap__gtt(fd, handle, LINEAR_DWORDS, PROT_READ); gem_set_domain(fd, handle, I915_GEM_DOMAIN_GTT, 0); j = rand() % (WIDTH * HEIGHT); igt_assert_f(data[j] == j, "mismatch at %i: %i\n", j, data[j]); -- cgit v1.2.3