[PATCH 7/8] drm/amd: fix compiler error to support older compilers

Christian König ckoenig.leichtzumerken at gmail.com
Fri Mar 31 06:17:15 UTC 2023


Am 30.03.23 um 21:48 schrieb Alex Deucher:
> From: Harish Kasiviswanathan <Harish.Kasiviswanathan at amd.com>
>
> ‘for’ loop initial declarations are only allowed in C99 or C11 mode

This isn't necessary any more and can be dropped.

Christian.

>
> Signed-off-by: Harish Kasiviswanathan <Harish.Kasiviswanathan at amd.com>
> Reviewed-by: Mukul Joshi <mukul.joshi at amd.com>
> Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/aqua_vanjaram_reg_init.c | 4 ++--
>   1 file 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);



More information about the amd-gfx mailing list