Skip to content

Commit

Permalink
drm/amd: fix compiler error to support older compilers
Browse files Browse the repository at this point in the history
‘for’ loop initial declarations are only allowed in C99 or C11 mode

Signed-off-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com>
Reviewed-by: Mukul Joshi <mukul.joshi@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
  • Loading branch information
Harish Kasiviswanathan authored and Alex Deucher committed Jun 9, 2023
1 parent b7c7011 commit 5ca1cee
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/gpu/drm/amd/amdgpu/aqua_vanjaram_reg_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ static int aqua_vanjaram_xcp_mgr_init(struct amdgpu_device *adev)

int aqua_vanjaram_init_soc_config(struct amdgpu_device *adev)
{
u32 inst_mask = adev->sdma.sdma_mask;
u32 mask, inst_mask = adev->sdma.sdma_mask;
int ret, i, num_inst;

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

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

0 comments on commit 5ca1cee

Please sign in to comment.