[igt-dev] [PATCH i-g-t 4/4] gem_exec_lut_handle: Initialize c

Petri Latvala petri.latvala at intel.com
Wed Mar 13 12:06:41 UTC 2019


The code that uses c deceivingly looks like it works with any initial
value of c, it doesn't work the same for negative values. In addition
initializing it to 0 makes the results deterministic.

Signed-off-by: Petri Latvala <petri.latvala at intel.com>
---
 tests/i915/gem_exec_lut_handle.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/i915/gem_exec_lut_handle.c b/tests/i915/gem_exec_lut_handle.c
index 98e6ae5a..d252d75d 100644
--- a/tests/i915/gem_exec_lut_handle.c
+++ b/tests/i915/gem_exec_lut_handle.c
@@ -85,7 +85,7 @@ igt_simple_main
 {
 	uint32_t batch[2] = {MI_BATCH_BUFFER_END};
 	uint32_t cycle[16];
-	int fd, n, m, count, c;
+	int fd, n, m, count, c = 0;
 	const struct {
 		const char *name;
 		unsigned int flags;
-- 
2.19.1



More information about the igt-dev mailing list