Skip to contentSkip to conversation

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

PATCH In review Jocelyn Falempe 2 participants 2 messages Sep 8, 2022 – Sep 9, 2022

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

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

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")
---
 drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c +1 -1
index 8e4c9d0887ce..56f02b1ea808 100644
@@ -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)
Signature · 1 line
2.37.3
#1 lore raw

Already fixed a few days ago. Thanks for the patch.

Alex

Quoted 35 lines · Jocelyn Falempe

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")
---
 drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c +1 -2
index 8e4c9d0887ce..56f02b1ea808 100644
@@ -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