[igt-dev] [PATCH] lib/igt_kms: Fix mixed declarations warning

Petri Latvala petri.latvala at intel.com
Mon May 30 08:50:03 UTC 2022


On Mon, May 30, 2022 at 01:10:36PM +0530, Bhanuprakash Modem wrote:
> Fix mixed declarations warning introduced by (58a5a2d5)
> 
> [214/1052] Compiling C object lib/libigt-igt_kms_c.a.p/igt_kms.c.o
> ../lib/igt_kms.c: In function ‘igt_display_require’:
> ../lib/igt_kms.c:2468:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
>  2468 |   igt_output_t *output = igt_get_single_output_for_pipe(display, i);
>       |   ^~~~~~~~~~~~
> 
> Cc: Jessica Zhang <quic_jesszhan at quicinc.com>
> Cc: Petri Latvala <petri.latvala at intel.com>
> Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem at intel.com>

Reviewed-by: Petri Latvala <petri.latvala at intel.com>


> ---
>  lib/igt_kms.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> index 457462ec..a8a4fc7c 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -2498,11 +2498,12 @@ out:
>  
>  	for_each_pipe(display, i) {
>  		igt_pipe_t *pipe = &display->pipes[i];
> +		igt_output_t *output;
>  
>  		if (!igt_pipe_has_valid_output(display, i))
>  			continue;
>  
> -		igt_output_t *output = igt_get_single_output_for_pipe(display, i);
> +		output = igt_get_single_output_for_pipe(display, i);
>  
>  		if (pipe->num_primary_planes > 1) {
>  			igt_plane_t *primary = &pipe->planes[pipe->plane_primary];
> -- 
> 2.35.1
> 


More information about the igt-dev mailing list