[PATCH i-g-t 14/16] tests/kms_content_protection: use for_each_output()

Jani Nikula
2026-04-14T07:16:43Z

Use for_each_output() instead of manually iterating display->outputs[i].

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
tests/kms_content_protection.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/kms_content_protection.c b/tests/kms_content_protection.c
index caf3d7a56ae4..a42f699e9c64 100644
--- a/tests/kms_content_protection.c
+++ b/tests/kms_content_protection.c
@@ -395,10 +395,10 @@ static void test_cp_enable_with_retry(igt_output_t *output,
static bool igt_crtc_is_free(igt_crtc_t *crtc)
{
igt_display_t *display = crtc->display;
- int i;
+ igt_output_t *output;

- for (i = 0; i < display->n_outputs; i++)
- if (igt_output_get_driving_crtc(&display->outputs[i]) == crtc)
+ for_each_output(display, output)
+ if (igt_output_get_driving_crtc(output) == crtc)
return false;

return true;
--
2.47.3