panfrost: split asserts in pandecode
authorTomeu Vizoso <tomeu.vizoso@collabora.com>
Thu, 11 Apr 2019 07:09:17 +0000 (09:09 +0200)
committerTomeu Vizoso <tomeu.vizoso@collabora.com>
Fri, 12 Apr 2019 05:11:52 +0000 (07:11 +0200)
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
src/gallium/drivers/panfrost/pandecode/mmap.h

index 1a208336e81418730c281fa68e85e7ff905e167d..e9acae877f7f266694f5764e05c36fab274de59e 100644 (file)
@@ -54,9 +54,8 @@ __pandecode_fetch_gpu_mem(const struct pandecode_mapped_memory *mem,
         if (!mem)
                 mem = pandecode_find_mapped_gpu_mem_containing(gpu_va);
 
-        if (!mem ||
-                        size + (gpu_va - mem->gpu_va) > mem->length)
-                assert(0);
+        assert(mem);
+        assert(size + (gpu_va - mem->gpu_va) <= mem->length);
 
         return mem->addr + gpu_va - mem->gpu_va;
 }