[igt-dev] [PATCH i-g-t] tests/kms_prime: Fix compiler warning

Mika Kahola mika.kahola at intel.com
Wed Sep 18 09:59:19 UTC 2019


Fix compiler warning about

../tests/kms_prime.c: In function ‘setup_display’:
../tests/kms_prime.c:74:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
  igt_output_t *output = igt_get_single_output_for_pipe(display, pipe);

Signed-off-by: Mika Kahola <mika.kahola at intel.com>
---
 tests/kms_prime.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tests/kms_prime.c b/tests/kms_prime.c
index 17599573..3241c514 100644
--- a/tests/kms_prime.c
+++ b/tests/kms_prime.c
@@ -69,9 +69,11 @@ static bool has_prime_export(int fd)
 static igt_output_t *setup_display(int importer_fd, igt_display_t *display,
 				   enum pipe pipe)
 {
+	igt_output_t *output;
+
 	igt_display_require(display, importer_fd);
 	igt_skip_on(pipe >= display->n_pipes);
-	igt_output_t *output = igt_get_single_output_for_pipe(display, pipe);
+	output = igt_get_single_output_for_pipe(display, pipe);
 
 	igt_require_f(output, "No connector found for pipe %s\n",
 		      kmstest_pipe_name(pipe));
-- 
2.17.1



More information about the igt-dev mailing list