mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2026-08-23 14:23:03 +00:00
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>
This commit is contained in:
+1
-1
@@ -78,7 +78,7 @@ dontneed_after_mmap(void)
|
||||
|
||||
handle = gem_create(fd, OBJECT_SIZE);
|
||||
ptr = gem_mmap__gtt(fd, handle, OBJECT_SIZE, PROT_READ | PROT_WRITE);
|
||||
igt_assert(ptr != NULL);
|
||||
igt_assert(ptr);
|
||||
gem_madvise(fd, handle, I915_MADV_DONTNEED);
|
||||
close(fd);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user