RE: [PATCH] drm/amdgpu: fix a compiling error in old kernels

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Reviewed-by: Guchun Chen <guchun.chen@xxxxxxx>

Regards,
Guchun

-----Original Message-----
From: Song, Asher <Asher.Song@xxxxxxx> 
Sent: Tuesday, September 27, 2022 11:38 AM
To: Chen, Guchun <Guchun.Chen@xxxxxxx>; Cui, Flora <Flora.Cui@xxxxxxx>; Shi, Leslie <Yuliang.Shi@xxxxxxx>; Ma, Jun <Jun.Ma2@xxxxxxx>; amd-gfx@xxxxxxxxxxxxxxxxxxxxx
Cc: Song, Asher <Asher.Song@xxxxxxx>
Subject: [PATCH] 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 <Asher.Song@xxxxxxx>
---
 drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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 772ad200c5da..c91fcde7a16c 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c
@@ -1405,8 +1405,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);
 
--
2.25.1





[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux