diff mbox series

drm/amd/display: Remove var declaration in dcn32_full_validate_bw_helper()

Message ID 20220908085022.1263639-1-jfalempe@redhat.com (mailing list archive)
State New, archived
Headers show
Series drm/amd/display: Remove var declaration in dcn32_full_validate_bw_helper() | expand

Commit Message

Jocelyn Falempe Sept. 8, 2022, 8:50 a.m. UTC
The variable i is already declared as uint32_t in the same function.

This fixes the following error, when compiling this code on older kernel:
drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn32/dcn32_fpu.c: In function 'dcn32_full_validate_bw_helper':
drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn32/dcn32_fpu.c:1018:3: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
   for (int i = 0; i < dc->res_pool->pipe_count; i++) {
   ^~~
drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn32/dcn32_fpu.c:1018:3: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code
drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn32/dcn32_fpu.c:982:11: error: unused variable 'i' [-Werror=unused-variable]
  uint32_t i = 0;

Fixes: f5b9c1ffabce ("drm/amd/display: Re-initialize viewport after pipe merge")

Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
---
 drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Alex Deucher Sept. 9, 2022, 9:03 p.m. UTC | #1
Already fixed a few days ago.  Thanks for the patch.

Alex

On Thu, Sep 8, 2022 at 4:51 AM Jocelyn Falempe <jfalempe@redhat.com> wrote:
>
> The variable i is already declared as uint32_t in the same function.
>
> This fixes the following error, when compiling this code on older kernel:
> drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn32/dcn32_fpu.c: In function 'dcn32_full_validate_bw_helper':
> drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn32/dcn32_fpu.c:1018:3: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
>    for (int i = 0; i < dc->res_pool->pipe_count; i++) {
>    ^~~
> drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn32/dcn32_fpu.c:1018:3: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code
> drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn32/dcn32_fpu.c:982:11: error: unused variable 'i' [-Werror=unused-variable]
>   uint32_t i = 0;
>
> Fixes: f5b9c1ffabce ("drm/amd/display: Re-initialize viewport after pipe merge")
>
> Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
> ---
>  drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c b/drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c
> index 8e4c9d0887ce..56f02b1ea808 100644
> --- a/drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c
> +++ b/drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c
> @@ -1015,7 +1015,7 @@ static void dcn32_full_validate_bw_helper(struct dc *dc,
>
>                 dcn32_merge_pipes_for_subvp(dc, context);
>                 // to re-initialize viewport after the pipe merge
> -               for (int i = 0; i < dc->res_pool->pipe_count; i++) {
> +               for (i = 0; i < dc->res_pool->pipe_count; i++) {
>                         struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i];
>
>                         if (!pipe_ctx->plane_state || !pipe_ctx->stream)
> --
> 2.37.3
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c b/drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c
index 8e4c9d0887ce..56f02b1ea808 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c
@@ -1015,7 +1015,7 @@  static void dcn32_full_validate_bw_helper(struct dc *dc,
 
 		dcn32_merge_pipes_for_subvp(dc, context);
 		// to re-initialize viewport after the pipe merge
-		for (int i = 0; i < dc->res_pool->pipe_count; i++) {
+		for (i = 0; i < dc->res_pool->pipe_count; i++) {
 			struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i];
 
 			if (!pipe_ctx->plane_state || !pipe_ctx->stream)