Replace __gem_mmap__{cpu,gtt,wc}() + igt_assert() with gem_mmap__{cpu,gtt,wc}()

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ä <ville.syrjala@linux.intel.com>
Stochastically-reviwewed-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Ville Syrjälä
2015-10-09 19:11:39 +03:00
parent b8a77dd6c8
commit f52e7ec787
45 changed files with 158 additions and 261 deletions
+2 -4
View File
@@ -65,8 +65,7 @@ create_bo(int fd)
gem_set_tiling(fd, handle, I915_TILING_X, WIDTH * sizeof(uint32_t));
/* Fill the BO with dwords starting at start_val */
data = __gem_mmap__gtt(fd, handle, SIZE, PROT_READ | PROT_WRITE);
igt_assert(data);
data = gem_mmap__gtt(fd, handle, SIZE, PROT_READ | PROT_WRITE);
for (i = 0; i < WIDTH*HEIGHT; i++)
data[i] = i;
munmap(data, SIZE);
@@ -174,8 +173,7 @@ igt_simple_main
first_page = offset & ~(PAGE_SIZE-1);
last_page = (offset + len + PAGE_SIZE) & ~(PAGE_SIZE-1);
linear = __gem_mmap__wc(fd, handle, first_page, last_page - first_page, PROT_READ);
igt_assert(linear);
linear = gem_mmap__wc(fd, handle, first_page, last_page - first_page, PROT_READ);
/* Translate from offsets in the read buffer to the swizzled
* address that it corresponds to. This is the opposite of