public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Mika Kahola <mika.kahola@intel.com>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH i-g-t v2 8/9] lib/igt_kms: Add more braces around macros
Date: Mon, 15 Jan 2018 14:01:42 +0200	[thread overview]
Message-ID: <1516017702.12453.93.camel@intel.com> (raw)
In-Reply-To: <20180112102116.4670-9-maarten.lankhorst@linux.intel.com>

On Fri, 2018-01-12 at 11:21 +0100, Maarten Lankhorst wrote:
> The next patch wants to call for_each_pipe_with_valid_output
> with *pipe and *output, this fails miserably without these braces.
> 

Reviewed-by: Mika Kahola <mika.kahola@intel.com>

> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
>  lib/igt_kms.h | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/lib/igt_kms.h b/lib/igt_kms.h
> index 1cf9422c0d12..85e9564adf34 100644
> --- a/lib/igt_kms.h
> +++ b/lib/igt_kms.h
> @@ -430,8 +430,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:
> @@ -469,11 +469,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:
> @@ -486,8 +486,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__], \
-- 
Mika Kahola - Intel OTC

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

  reply	other threads:[~2018-01-15 11:58 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-12 10:21 [PATCH i-g-t v2 0/9] kms plane scaling tests Maarten Lankhorst
2018-01-12 10:21 ` [PATCH i-g-t v2 1/9] tests/kms_plane: Run test for all supported pixel formats, v2 Maarten Lankhorst
2018-01-12 13:52   ` Mika Kahola
2018-01-12 10:21 ` [PATCH i-g-t v2 2/9] tests/kms_plane_scaling: Move the actual test to its own function Maarten Lankhorst
2018-01-15  8:47   ` Mika Kahola
2018-01-12 10:21 ` [PATCH i-g-t v2 3/9] tests/kms_plane_scaling: Fix basic scaling test, v2 Maarten Lankhorst
2018-01-15  9:01   ` Mika Kahola
2018-01-12 10:21 ` [PATCH i-g-t v2 4/9] tests/kms_plane_scaling: Convert from simple test to full test Maarten Lankhorst
2018-01-15  9:10   ` Mika Kahola
2018-01-12 10:21 ` [PATCH i-g-t v2 5/9] tests/kms_plane_scaling: Clean up tests to work better with igt_kms Maarten Lankhorst
2018-01-12 10:21 ` [PATCH i-g-t v2 6/9] tests/kms_plane_scaling: test scaling with tiling rotation and pixel formats, v2 Maarten Lankhorst
2018-01-12 10:21 ` [PATCH i-g-t v2 7/9] tests/kms_plane_scaling: test scaler with clipping clamping, v2 Maarten Lankhorst
2018-01-12 10:21 ` [PATCH i-g-t v2 8/9] lib/igt_kms: Add more braces around macros Maarten Lankhorst
2018-01-15 12:01   ` Mika Kahola [this message]
2018-01-12 10:21 ` [PATCH i-g-t v2 9/9] tests/kms_plane_scaling: test for multi pipe with scaling Maarten Lankhorst
2018-01-12 13:09 ` ✓ Fi.CI.BAT: success for kms plane scaling tests Patchwork
2018-01-12 13:58 ` ✓ Fi.CI.IGT: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1516017702.12453.93.camel@intel.com \
    --to=mika.kahola@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=maarten.lankhorst@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox