All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amd/display: fix compilation issue with legacy gcc
@ 2022-11-18  1:06 bobzhou
  2022-11-18  2:00 ` Chen, Guchun
  0 siblings, 1 reply; 2+ messages in thread
From: bobzhou @ 2022-11-18  1:06 UTC (permalink / raw)
  To: amd-gfx; +Cc: Bob zhou, Guchun.Chen

From: Bob zhou <bobzhou2@amd.com>

    This patch is used to fix following compilation issue with legacy gcc

    error: ‘for’ loop initial declarations are only allowed in C99 mode
	for (int i = flag_vlevel; i < context->bw_ctx.dml.soc.num_states; i++) {

Signed-off-by: Bob zhou <bobzhou2@amd.com>
---
 drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 3 ++-
 1 file changed, 2 insertions(+), 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 7e64ea6a0973..97c15c4d2805 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
@@ -1761,6 +1761,7 @@ bool dcn32_internal_validate_bw(struct dc *dc,
 	if (repopulate_pipes) {
 		int flag_max_mpc_comb = vba->maxMpcComb;
 		int flag_vlevel = vlevel;
+		int i;
 
 		pipe_cnt = dc->res_pool->funcs->populate_dml_pipes(dc, context, pipes, fast_validate);
 
@@ -1779,7 +1780,7 @@ bool dcn32_internal_validate_bw(struct dc *dc,
 				flag_max_mpc_comb != context->bw_ctx.dml.vba.maxMpcComb) {
 			/* check the context constructed with pipe split flags is still valid*/
 			bool flags_valid = false;
-			for (int i = flag_vlevel; i < context->bw_ctx.dml.soc.num_states; i++) {
+			for (i = flag_vlevel; i < context->bw_ctx.dml.soc.num_states; i++) {
 				if (vba->ModeSupport[i][flag_max_mpc_comb]) {
 					vba->maxMpcComb = flag_max_mpc_comb;
 					vba->VoltageLevel = i;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* RE: [PATCH] drm/amd/display: fix compilation issue with legacy gcc
  2022-11-18  1:06 [PATCH] drm/amd/display: fix compilation issue with legacy gcc bobzhou
@ 2022-11-18  2:00 ` Chen, Guchun
  0 siblings, 0 replies; 2+ messages in thread
From: Chen, Guchun @ 2022-11-18  2:00 UTC (permalink / raw)
  To: Zhou, Bob, amd-gfx; +Cc: Zhou, Bob

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

Regards,
Guchun

-----Original Message-----
From: bobzhou <bobzhou2@amd.com> 
Sent: Friday, November 18, 2022 9:06 AM
To: amd-gfx@lists.freedesktop.org
Cc: Chen, Guchun <Guchun.Chen@amd.com>; Zhou, Bob <Bob.Zhou@amd.com>
Subject: [PATCH] drm/amd/display: fix compilation issue with legacy gcc

From: Bob zhou <bobzhou2@amd.com>

    This patch is used to fix following compilation issue with legacy gcc

    error: ‘for’ loop initial declarations are only allowed in C99 mode
	for (int i = flag_vlevel; i < context->bw_ctx.dml.soc.num_states; i++) {

Signed-off-by: Bob zhou <bobzhou2@amd.com>
---
 drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 3 ++-
 1 file changed, 2 insertions(+), 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 7e64ea6a0973..97c15c4d2805 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
@@ -1761,6 +1761,7 @@ bool dcn32_internal_validate_bw(struct dc *dc,
 	if (repopulate_pipes) {
 		int flag_max_mpc_comb = vba->maxMpcComb;
 		int flag_vlevel = vlevel;
+		int i;
 
 		pipe_cnt = dc->res_pool->funcs->populate_dml_pipes(dc, context, pipes, fast_validate);
 
@@ -1779,7 +1780,7 @@ bool dcn32_internal_validate_bw(struct dc *dc,
 				flag_max_mpc_comb != context->bw_ctx.dml.vba.maxMpcComb) {
 			/* check the context constructed with pipe split flags is still valid*/
 			bool flags_valid = false;
-			for (int i = flag_vlevel; i < context->bw_ctx.dml.soc.num_states; i++) {
+			for (i = flag_vlevel; i < context->bw_ctx.dml.soc.num_states; i++) {
 				if (vba->ModeSupport[i][flag_max_mpc_comb]) {
 					vba->maxMpcComb = flag_max_mpc_comb;
 					vba->VoltageLevel = i;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-11-18  2:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-18  1:06 [PATCH] drm/amd/display: fix compilation issue with legacy gcc bobzhou
2022-11-18  2:00 ` Chen, Guchun

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.