diff options
author | Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com> | 2023-01-21 15:47:11 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2023-06-09 09:52:21 -0400 |
commit | 5ca1ceebab140b36928dabc9a5b36b9a3010e844 (patch) | |
tree | 16c4fccc5eb58555ffe7e69673fa6884a70e18f3 /drivers/gpu/drm/amd/amdgpu/aqua_vanjaram_reg_init.c | |
parent | b7c7011e67b09efc486b1de38f6bfbed75139989 (diff) | |
download | lwn-5ca1ceebab140b36928dabc9a5b36b9a3010e844.tar.gz lwn-5ca1ceebab140b36928dabc9a5b36b9a3010e844.zip |
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 <Harish.Kasiviswanathan@amd.com>
Reviewed-by: Mukul Joshi <mukul.joshi@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/aqua_vanjaram_reg_init.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/aqua_vanjaram_reg_init.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/aqua_vanjaram_reg_init.c b/drivers/gpu/drm/amd/amdgpu/aqua_vanjaram_reg_init.c index 55a6ebb940ba..fdc728f678d7 100644 --- a/drivers/gpu/drm/amd/amdgpu/aqua_vanjaram_reg_init.c +++ b/drivers/gpu/drm/amd/amdgpu/aqua_vanjaram_reg_init.c @@ -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 */ @@ -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); |