From: Asher Song Date: Tue, 27 Sep 2022 07:22:53 +0000 (+0800) Subject: drm/amdgpu: fix a compiling error in old kernels X-Git-Tag: v6.6.17~6361^2~4^2~17 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9e447c811ab31cd69d8fff18283fb695e1ff59a5;p=platform%2Fkernel%2Flinux-rpi.git drm/amdgpu: fix a compiling error in old kernels This patch is used to fix following compiling error that occurs in some old kernels. error: ‘for’ loop initial declarations are only allowed in C99 mode for (int i = 0; i < dc->res_pool->res_cap->num_dsc; i++) { Signed-off-by: Asher Song Reviewed-by: Guchun Chen Reviewed-by: Christian König Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c index 28745e2..a750343c 100644 --- a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c +++ b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c @@ -1402,8 +1402,9 @@ void dcn32_update_dsc_pg(struct dc *dc, bool safe_to_disable) { struct dce_hwseq *hws = dc->hwseq; + int i; - for (int i = 0; i < dc->res_pool->res_cap->num_dsc; i++) { + for (i = 0; i < dc->res_pool->res_cap->num_dsc; i++) { struct display_stream_compressor *dsc = dc->res_pool->dscs[i]; bool is_dsc_ungated = hws->funcs.dsc_pg_status(hws, dsc->inst);