[PATCH 1/8] tests/pm_psr_sink_crc: Fix longjmp fun

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



igt_fixture and igt_subtests use longjmp/setjmp internally, which
means local variables at the same stack frame are at risk. Best
practice is to move them out right in front of the igt_main block.

It would be awesome if someone could come up with a cocci patch to
auto-fix this, but unfortunately my attempts failed.

Signed-off-by: Daniel Vetter <daniel.vetter@xxxxxxxx>
---
 tests/kms_psr_sink_crc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/kms_psr_sink_crc.c b/tests/kms_psr_sink_crc.c
index 999a0bfd0bb6..c2c12d119163 100644
--- a/tests/kms_psr_sink_crc.c
+++ b/tests/kms_psr_sink_crc.c
@@ -587,11 +587,11 @@ static void run_test(data_t *data)
 	}
 }
 
+data_t data = {};
+enum tests test;
+
 igt_main
 {
-	data_t data = {};
-	enum tests test;
-
 	igt_skip_on_simulation();
 
 	igt_fixture {
-- 
2.0.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux