Skip to content

Commit 6bb811d

Browse files
bobzhoualexdeucher
authored andcommitted
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]> Reviewed-by: Guchun Chen <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent a8af68f commit 6bb811d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,11 @@ static void vcn_v4_0_set_ras_funcs(struct amdgpu_device *adev);
7878
static int vcn_v4_0_early_init(void *handle)
7979
{
8080
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
81+
int i;
8182

8283
if (amdgpu_sriov_vf(adev)) {
8384
adev->vcn.harvest_config = VCN_HARVEST_MMSCH;
84-
for (int i = 0; i < adev->vcn.num_vcn_inst; ++i) {
85+
for (i = 0; i < adev->vcn.num_vcn_inst; ++i) {
8586
if (amdgpu_vcn_is_disabled_vcn(adev, VCN_ENCODE_RING, i)) {
8687
adev->vcn.harvest_config |= 1 << i;
8788
dev_info(adev->dev, "VCN%d is disabled by hypervisor\n", i);

0 commit comments

Comments
 (0)