Commit 34296cf6 authored by Maarten Lankhorst's avatar Maarten Lankhorst

lib/igt_kms: Add more braces around macros

The next patch wants to call for_each_pipe_with_valid_output
with *pipe and *output, this fails miserably without these braces.
Signed-off-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: default avatarMika Kahola <mika.kahola@intel.com>
parent d28d2b25
......@@ -429,8 +429,8 @@ static inline bool igt_output_is_connected(igt_output_t *output)
*/
#define for_each_connected_output(display, output) \
for (int i__ = 0; assert(igt_can_fail()), i__ < (display)->n_outputs; i__++) \
for_each_if (((output = &(display)->outputs[i__]), \
igt_output_is_connected(output)))
for_each_if ((((output) = &(display)->outputs[i__]), \
igt_output_is_connected((output))))
/**
* for_each_pipe:
......@@ -468,11 +468,11 @@ static inline bool igt_output_is_connected(igt_output_t *output)
* will try every combination of @pipe and @output.
*/
#define for_each_pipe_with_valid_output(display, pipe, output) \
for (int con__ = pipe = 0; \
assert(igt_can_fail()), pipe < igt_display_get_n_pipes((display)) && con__ < (display)->n_outputs; \
for (int con__ = (pipe) = 0; \
assert(igt_can_fail()), (pipe) < igt_display_get_n_pipes((display)) && con__ < (display)->n_outputs; \
con__ = (con__ + 1 < (display)->n_outputs) ? con__ + 1 : (pipe = pipe + 1, 0)) \
for_each_if (((output = &(display)->outputs[con__]), \
igt_pipe_connector_valid(pipe, output)))
for_each_if ((((output) = &(display)->outputs[con__]), \
igt_pipe_connector_valid((pipe), (output))))
/**
* for_each_valid_output_on_pipe:
......@@ -485,8 +485,8 @@ static inline bool igt_output_is_connected(igt_output_t *output)
* happens.
*/
#define for_each_valid_output_on_pipe(display, pipe, output) \
for_each_connected_output(display, output) \
for_each_if (igt_pipe_connector_valid(pipe, output))
for_each_connected_output((display), (output)) \
for_each_if (igt_pipe_connector_valid((pipe), (output)))
#define for_each_plane_on_pipe(display, pipe, plane) \
for (int j__ = 0; assert(igt_can_fail()), (plane) = &(display)->pipes[(pipe)].planes[j__], \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment