mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2026-08-22 13:52:54 +00:00
Sprinkle igt_assert(ptr) after gem_mmap__{cpu,gtt,wc}
Do the following
ptr = gem_mmap__{cpu,gtt,wc}()
+igt_assert(ptr);
whenever the code doesn't handle the NULL ptr in any kind of
specific way.
Makes it easier to move the assert into gem_mmap__{cpu,gtt,wc}() itself.
Mostly done with coccinelle, with some manual cleanups:
@@
identifier I;
@@
<... when != igt_assert(I)
when != igt_require(I)
when != igt_require_f(I, ...)
when != I != NULL
when != I == NULL
(
I = gem_mmap__gtt(...);
+ igt_assert(I);
|
I = gem_mmap__cpu(...);
+ igt_assert(I);
|
I = gem_mmap__wc(...);
+ 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:
@@ -117,6 +117,7 @@ static void run_on_ring(int fd, unsigned ring_id, const char *ring_name)
|
||||
handle_new = gem_create(fd, BATCH_SIZE);
|
||||
batch_ptr = gem_mmap__cpu(fd, handle_new, 0, BATCH_SIZE,
|
||||
PROT_READ | PROT_WRITE);
|
||||
igt_assert(batch_ptr);
|
||||
batch_ptr[split*2] = MI_BATCH_BUFFER_END;
|
||||
|
||||
for (i = split*2 + 2; i < BATCH_SIZE/8; i++)
|
||||
|
||||
Reference in New Issue
Block a user