RE: [PATCH] drm/amdgpu/vcn: fix compilation issue with legacy gcc

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

 



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

Regards,
Guchun

-----Original Message-----
From: bobzhou <bob.zhou@xxxxxxx> 
Sent: Thursday, February 23, 2023 3:13 PM
To: amd-gfx@xxxxxxxxxxxxxxxxxxxxx; Chen, Guchun <Guchun.Chen@xxxxxxx>; Cui, Flora <Flora.Cui@xxxxxxx>; Shi, Leslie <Yuliang.Shi@xxxxxxx>; Ma, Jun <Jun.Ma2@xxxxxxx>
Cc: Zhou, Bob <Bob.Zhou@xxxxxxx>
Subject: [PATCH] drm/amdgpu/vcn: fix compilation issue with legacy gcc

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 = 0; i < adev->vcn.num_vcn_inst; ++i) {

Signed-off-by: bobzhou <bob.zhou@xxxxxxx>
---
 drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c
index 213b43670f23..2331383490ff 100644
--- a/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c
@@ -79,10 +79,11 @@ static int vcn_v4_0_early_init(void *handle)  {
 	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
 	struct amdgpu_ring *ring;
+	int i;
 
 	if (amdgpu_sriov_vf(adev)) {
 		adev->vcn.harvest_config = VCN_HARVEST_MMSCH;
-		for (int i = 0; i < adev->vcn.num_vcn_inst; ++i) {
+		for (i = 0; i < adev->vcn.num_vcn_inst; ++i) {
 			ring = &adev->vcn.inst[i].ring_enc[0];
 			if (amdgpu_vcn_is_disabled_vcn(adev, VCN_ENCODE_RING, i)) {
 				adev->vcn.harvest_config |= 1 << i;
--
2.34.1





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

  Powered by Linux