drm/amd/display: Remove var declaration in dcn32_full_validate_bw_helper()
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;
--- 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
@@ -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
Already fixed a few days ago. Thanks for the patch.
Alex
Quoted 35 lines · Jocelyn Falempe
The variable i is already declared as
uint32_tin 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 modefor (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 codedrivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn32/dcn32_fpu.c:982:11: error: unused variable 'i' [-Werror=unused-variable]
uint32_ti = 0;Fixes f5b9c1ffabce ("drm/amd/display: Re-initialize viewport after pipe merge")Signed-off-by Jocelyn Falempe <[email protected]>--- 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@@ -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