summaryrefslogtreecommitdiff
path: root/tests/gem_userptr_blits.c
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2015-10-09 17:00:29 +0300
committerVille Syrjälä <ville.syrjala@linux.intel.com>2015-10-09 17:09:45 +0300
commit91d295cf06aeee733b57ec87933dba47ed2c8440 (patch)
treee7701a2e4470ae638d760266e0477f8ac5b689f6 /tests/gem_userptr_blits.c
parent8986bbc0ce83c1df4c314c9c04d30608cacae98b (diff)
Remove gem_mmap__{cpu,gtt,wc} return value MAP_FAILED asserts
gem_mmap__{cpu,gtt,wc} never return MAP_FAILED, it gets converted to NULL internally. So don't go asserting that the returned value is not MAP_FAILED. Done with coccinelle: @@ type T; identifier I; @@ ( I = gem_mmap__gtt(...); | I = gem_mmap__cpu(...); | I = gem_mmap__wc(...); ) ... ( - igt_assert(I != MAP_FAILED); + igt_assert(I); | - igt_assert(I && I != MAP_FAILED); + igt_assert(I); | - igt_assert(I != (T *) MAP_FAILED); + igt_assert(I); | - igt_assert(I != NULL); + igt_assert(I); ) Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Stochastically-reviwewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests/gem_userptr_blits.c')
-rw-r--r--tests/gem_userptr_blits.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/gem_userptr_blits.c b/tests/gem_userptr_blits.c
index d161b6ca..6fff3a9e 100644
--- a/tests/gem_userptr_blits.c
+++ b/tests/gem_userptr_blits.c
@@ -546,7 +546,7 @@ static int test_invalid_gtt_mapping(int fd)
handle = create_bo(fd, 0);
ptr = gem_mmap__gtt(fd, handle, sizeof(linear), PROT_READ | PROT_WRITE);
gem_close(fd, handle);
- igt_assert(ptr != NULL);
+ igt_assert(ptr);
igt_assert(((unsigned long)ptr & (PAGE_SIZE - 1)) == 0);
igt_assert((sizeof(linear) & (PAGE_SIZE - 1)) == 0);