[Intel-gfx] [igt-dev] [PATCH i-g-t 2/2] tests/perf: Fix build warning

Lionel Landwerlin lionel.g.landwerlin at intel.com
Wed Feb 28 10:39:58 UTC 2018


Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>

On 28/02/18 10:08, Tvrtko Ursulin wrote:
> From: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
>
> Move variable declaration to top of scope to avoid C90 build warning.
>
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> ---
>   tests/perf.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tests/perf.c b/tests/perf.c
> index c302a355b850..78bf6cdd3504 100644
> --- a/tests/perf.c
> +++ b/tests/perf.c
> @@ -1726,6 +1726,7 @@ test_oa_exponents(void)
>   		int buf_size = sample_size * max_reports * 1.5;
>   		uint8_t *buf = calloc(1, buf_size);
>   		int ret, n_timer_reports = 0;
> +		uint32_t matches = 0;
>   		struct {
>   			uint32_t report[64];
>   		} timer_reports[30];
> @@ -1785,7 +1786,6 @@ test_oa_exponents(void)
>   		igt_debug("report%04i ts=%08x hw_id=0x%08x\n", 0,
>   			  timer_reports[0].report[1],
>   			  oa_report_get_ctx_id(timer_reports[0].report));
> -		uint32_t matches = 0;
>   		for (int i = 1; i < n_timer_reports; i++) {
>   			uint32_t delta =
>   				timer_reports[i].report[1] - timer_reports[i - 1].report[1];




More information about the Intel-gfx mailing list