summaryrefslogtreecommitdiff
path: root/tests/kms_psr_sink_crc.c
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2015-10-09 18:19:34 +0300
committerVille Syrjälä <ville.syrjala@linux.intel.com>2015-10-09 18:33:30 +0300
commit7eaae3c2013b6d4bdf11570d3fb9d95eb4978976 (patch)
treed20ecd068c4645c7855af74452fbe2b58775a89d /tests/kms_psr_sink_crc.c
parent91d295cf06aeee733b57ec87933dba47ed2c8440 (diff)
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>
Diffstat (limited to 'tests/kms_psr_sink_crc.c')
-rw-r--r--tests/kms_psr_sink_crc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/kms_psr_sink_crc.c b/tests/kms_psr_sink_crc.c
index 77c92d33..720472f0 100644
--- a/tests/kms_psr_sink_crc.c
+++ b/tests/kms_psr_sink_crc.c
@@ -381,6 +381,7 @@ static void run_test(data_t *data)
case MMAP_GTT:
ptr = gem_mmap__gtt(data->drm_fd, handle, data->mod_size,
PROT_WRITE);
+ igt_assert(ptr);
gem_set_domain(data->drm_fd, handle,
I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
memset(ptr, 0xcc, data->mod_size);
@@ -390,6 +391,7 @@ static void run_test(data_t *data)
case MMAP_GTT_WAITING:
ptr = gem_mmap__gtt(data->drm_fd, handle, data->mod_size,
PROT_WRITE);
+ igt_assert(ptr);
gem_set_domain(data->drm_fd, handle,
I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);
@@ -412,6 +414,7 @@ static void run_test(data_t *data)
break;
case MMAP_CPU:
ptr = gem_mmap__cpu(data->drm_fd, handle, 0, data->mod_size, PROT_WRITE);
+ igt_assert(ptr);
gem_set_domain(data->drm_fd, handle,
I915_GEM_DOMAIN_CPU, I915_GEM_DOMAIN_CPU);
memset(ptr, 0, data->mod_size);