Reviewed-by: Guchun Chen <[email protected]>

Regards,
Guchun

-----Original Message-----
From: bobzhou <[email protected]> 
Sent: Thursday, February 23, 2023 3:13 PM
To: [email protected]; Chen, Guchun <[email protected]>; Cui, 
Flora <[email protected]>; Shi, Leslie <[email protected]>; Ma, Jun 
<[email protected]>
Cc: Zhou, Bob <[email protected]>
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 <[email protected]>
---
 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

Reply via email to