AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: fix a compiling error in old kernels
@ 2022-09-27  3:37 Asher Song
  2022-09-27  5:38 ` Chen, Guchun
  2022-09-27  6:15 ` Christian König
  0 siblings, 2 replies; 3+ messages in thread
From: Asher Song @ 2022-09-27  3:37 UTC (permalink / raw)
  To: Guchun.Chen, flora.cui, yuliang.shi, jun.ma2, amd-gfx; +Cc: Asher Song

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@amd.com>
---
 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


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

* RE: [PATCH] drm/amdgpu: fix a compiling error in old kernels
  2022-09-27  3:37 [PATCH] drm/amdgpu: fix a compiling error in old kernels Asher Song
@ 2022-09-27  5:38 ` Chen, Guchun
  2022-09-27  6:15 ` Christian König
  1 sibling, 0 replies; 3+ messages in thread
From: Chen, Guchun @ 2022-09-27  5:38 UTC (permalink / raw)
  To: Song, Asher, Cui, Flora, Shi, Leslie, Ma, Jun,
	amd-gfx@lists.freedesktop.org

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

Regards,
Guchun

-----Original Message-----
From: Song, Asher <Asher.Song@amd.com> 
Sent: Tuesday, September 27, 2022 11:38 AM
To: Chen, Guchun <Guchun.Chen@amd.com>; Cui, Flora <Flora.Cui@amd.com>; Shi, Leslie <Yuliang.Shi@amd.com>; Ma, Jun <Jun.Ma2@amd.com>; amd-gfx@lists.freedesktop.org
Cc: Song, Asher <Asher.Song@amd.com>
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@amd.com>
---
 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


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

* Re: [PATCH] drm/amdgpu: fix a compiling error in old kernels
  2022-09-27  3:37 [PATCH] drm/amdgpu: fix a compiling error in old kernels Asher Song
  2022-09-27  5:38 ` Chen, Guchun
@ 2022-09-27  6:15 ` Christian König
  1 sibling, 0 replies; 3+ messages in thread
From: Christian König @ 2022-09-27  6:15 UTC (permalink / raw)
  To: Asher Song, Guchun.Chen, flora.cui, yuliang.shi, jun.ma2, amd-gfx

Am 27.09.22 um 05:37 schrieb Asher Song:
> 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@amd.com>

Reviewed-by: Christian König <christian.koenig@amd.com>

> ---
>   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);
>   


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

end of thread, other threads:[~2022-09-27  6:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-27  3:37 [PATCH] drm/amdgpu: fix a compiling error in old kernels Asher Song
2022-09-27  5:38 ` Chen, Guchun
2022-09-27  6:15 ` Christian König

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox