Skip to content

Commit 5ca1cee

Browse files
hkasivisalexdeucher
authored andcommitted
drm/amd: fix compiler error to support older compilers
‘for’ loop initial declarations are only allowed in C99 or C11 mode Signed-off-by: Harish Kasiviswanathan <[email protected]> Reviewed-by: Mukul Joshi <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent b7c7011 commit 5ca1cee

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ static int aqua_vanjaram_xcp_mgr_init(struct amdgpu_device *adev)
360360

361361
int aqua_vanjaram_init_soc_config(struct amdgpu_device *adev)
362362
{
363-
u32 inst_mask = adev->sdma.sdma_mask;
363+
u32 mask, inst_mask = adev->sdma.sdma_mask;
364364
int ret, i, num_inst;
365365

366366
/* generally 1 AID supports 4 instances */
@@ -370,7 +370,7 @@ int aqua_vanjaram_init_soc_config(struct amdgpu_device *adev)
370370
adev->aid_mask = i = 1;
371371
inst_mask >>= adev->sdma.num_inst_per_aid;
372372

373-
for (const u32 mask = (1 << adev->sdma.num_inst_per_aid) - 1; inst_mask;
373+
for (mask = (1 << adev->sdma.num_inst_per_aid) - 1; inst_mask;
374374
inst_mask >>= adev->sdma.num_inst_per_aid, ++i) {
375375
if ((inst_mask & mask) == mask)
376376
adev->aid_mask |= (1 << i);

0 commit comments

Comments
 (0)