[Piglit] [PATCH v2] amd_performance_monitor: Fix multi-statement macro 'report'.

Ian Romanick idr at freedesktop.org
Tue May 7 17:11:31 PDT 2013


On 05/07/2013 02:06 PM, Vinson Lee wrote:
> Fixes "Nesting level does not match indentation" defect reported by
> Coverity.
>
> Signed-off-by: Vinson Lee <vlee at freedesktop.org>

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

> ---
>   tests/spec/amd_performance_monitor/api.c | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/tests/spec/amd_performance_monitor/api.c b/tests/spec/amd_performance_monitor/api.c
> index 7b321cf..3205fc0 100644
> --- a/tests/spec/amd_performance_monitor/api.c
> +++ b/tests/spec/amd_performance_monitor/api.c
> @@ -113,8 +113,10 @@ find_invalid_counter(unsigned *counters, int num_counters)
>   }
>
>   #define report(pass) \
> -    piglit_report_subtest_result((pass) ? PIGLIT_PASS : PIGLIT_FAIL, __FUNCTION__); \
> -    return
> +	do { \
> +		piglit_report_subtest_result((pass) ? PIGLIT_PASS : PIGLIT_FAIL, __FUNCTION__); \
> +		return; \
> +	} while (0)
>
>   /******************************************************************************/
>
>



More information about the Piglit mailing list