[igt-dev] [PATCH i-g-t 2/2] tests/i915_pipe_stress: Remove stack variables

Lisovskiy, Stanislav stanislav.lisovskiy at intel.com
Wed Sep 13 15:15:04 UTC 2023


On Wed, Sep 13, 2023 at 04:24:17PM +0200, Zbigniew Kempczyński wrote:
> They are unused and what's worse unassigned. Get rid of them keeping
> x/y_rand only.
> 
> Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
> Cc: Stanislav Lisovskiy <stanislav.lisovskiy at intel.com>
> ---
>  tests/intel/i915_pipe_stress.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/tests/intel/i915_pipe_stress.c b/tests/intel/i915_pipe_stress.c
> index 9ceb056a09..f9da5f0232 100644
> --- a/tests/intel/i915_pipe_stress.c
> +++ b/tests/intel/i915_pipe_stress.c
> @@ -241,7 +241,6 @@ static void *gpu_load(void *ptr)
>  	int frame_height;
>  	drmModeModeInfo *mode;
>  	int frame = 0;
> -	int x, y;
>  	int rect = 0, total_rects = 0;
>  	int pixels = 0;
>  
> @@ -273,8 +272,8 @@ static void *gpu_load(void *ptr)
>  			x_rand = hars_petruska_f54_1_random_unsafe_max(frame_width - rect_width);
>  			y_rand = hars_petruska_f54_1_random_unsafe_max(frame_height/2 - rect_height);
>  
> -			context->blt_rect.x = x + x_rand;
> -			context->blt_rect.y = y + y_rand;
> +			context->blt_rect.x = x_rand;
> +			context->blt_rect.y = y_rand;

Thanks for spotting,

Reviewed-by: Stanislav Lisovskiy <stanislav.lisovskiy at intel.com>

>  
>  			/* Fill randomly sized and positioned rectangles */
>  			fill_gpu(context, context->blt_rect.x, context->blt_rect.y,
> -- 
> 2.34.1
> 


More information about the igt-dev mailing list