summaryrefslogtreecommitdiff
path: root/tests/i915/gem_mmap_gtt.c
diff options
context:
space:
mode:
authorSimon Ser <simon.ser@intel.com>2019-05-07 15:40:44 +0300
committerSimon Ser <simon.ser@intel.com>2019-06-06 10:27:51 +0300
commiteabd43908205dd4ca6ce1e568cbd5459f3d904f5 (patch)
treea799587ff1a53593b518778b18458b7773b5a2cb /tests/i915/gem_mmap_gtt.c
parent4f2b9f5930fa33d091cf89637dc6e7f76f632a88 (diff)
tests/i915/gen_mmap: fix no-op loops
The loop condition is never satisfied, since after filling the array i > 0. For this reason the loop is always a no-op. Use a more conventional loop instead. Fixes: 964e39159c64 ("tests/i915/gem_mmap: Add invalid parameters tests") Signed-off-by: Simon Ser <simon.ser@intel.com> Acked-by: Antonio Argenziano <antonio.argenziano@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Diffstat (limited to 'tests/i915/gem_mmap_gtt.c')
-rw-r--r--tests/i915/gem_mmap_gtt.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/i915/gem_mmap_gtt.c b/tests/i915/gem_mmap_gtt.c
index 9a670f03..034658e6 100644
--- a/tests/i915/gem_mmap_gtt.c
+++ b/tests/i915/gem_mmap_gtt.c
@@ -886,14 +886,15 @@ igt_main
igt_subtest("bad-object") {
uint32_t real_handle = gem_create(fd, 4096);
uint32_t handles[20];
- int i = 0;
+ size_t i = 0, len;
handles[i++] = 0xdeadbeef;
for(int bit = 0; bit < 16; bit++)
handles[i++] = real_handle | (1 << (bit + 16));
- handles[i] = real_handle + 1;
+ handles[i++] = real_handle + 1;
+ len = i;
- for (; i < 0; i--) {
+ for (i = 0; i < len; ++i) {
struct drm_i915_gem_mmap_gtt arg = {
.handle = handles[i],
};