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

Brian Paul brianp at vmware.com
Tue May 7 15:35:52 PDT 2013


On 05/07/2013 03: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>
> ---
>   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)
>
>   /******************************************************************************/
>

Reviewed-by: Brian Paul <brianp at vmware.com>


More information about the Piglit mailing list