[igt-dev] [PATCH i-g-t] tests/kms_vrr: fix compilation with Clang

Simon Ser simon.ser at intel.com
Thu Mar 21 07:37:45 UTC 2019


Clang fails to compile this file with this error:

    ../tests/kms_vrr.c:203:20: error: suggest braces around
initialization of subobject [-Werror,-Wmissing-braces]
            drmVBlank vbl = { 0 };
                              ^
                              {}

As discussed in [1], using an empty initializer list is the preferred
way to fix this.

[1]: https://lists.freedesktop.org/archives/igt-dev/2019-March/010841.html

Signed-off-by: Simon Ser <simon.ser at intel.com>
---
 tests/kms_vrr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/kms_vrr.c b/tests/kms_vrr.c
index e4703f5f..9801b40a 100644
--- a/tests/kms_vrr.c
+++ b/tests/kms_vrr.c
@@ -200,7 +200,7 @@ static void prepare_test(data_t *data, igt_output_t *output, enum pipe pipe)
 static uint64_t
 wait_for_vblank(data_t *data, enum pipe pipe)
 {
-	drmVBlank vbl = { 0 };
+	drmVBlank vbl = {};
 
 	vbl.request.type = kmstest_get_vbl_flag(pipe);
 	vbl.request.type |= DRM_VBLANK_RELATIVE | DRM_VBLANK_EVENT;
-- 
2.21.0

---------------------------------------------------------------------
Intel Finland Oy
Registered Address: PL 281, 00181 Helsinki 
Business Identity Code: 0357606 - 4 
Domiciled in Helsinki 

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.



More information about the igt-dev mailing list