[PATCH] drm/amdgpu: Drop redundant unsigned >=0 comparision 'amdgpu_gfx_rlc_init_microcode()'

Zhou1, Tao Tao.Zhou1 at amd.com
Thu Dec 21 08:20:29 UTC 2023


[AMD Official Use Only - General]

Reviewed-by: Tao Zhou <tao.zhou1 at amd.com>

> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> On Behalf Of Srinivasan
> Shanmugam
> Sent: Wednesday, December 20, 2023 10:40 PM
> To: Deucher, Alexander <Alexander.Deucher at amd.com>; Koenig, Christian
> <Christian.Koenig at amd.com>
> Cc: SHANMUGAM, SRINIVASAN <SRINIVASAN.SHANMUGAM at amd.com>; amd-
> gfx at lists.freedesktop.org
> Subject: [PATCH] drm/amdgpu: Drop redundant unsigned >=0 comparision
> 'amdgpu_gfx_rlc_init_microcode()'
>
> unsigned int "version_minor" is always >= 0
>
> Fixes the below:
> drivers/gpu/drm/amd/amdgpu/amdgpu_rlc.c:534
> amdgpu_gfx_rlc_init_microcode() warn: always true condition '(version_minor >=
> 0) => (0-u16max >= 0)'
>
> Cc: Christian König <christian.koenig at amd.com>
> Cc: Alex Deucher <alexander.deucher at amd.com>
> Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam at amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_rlc.c | 11 +++++------
>  1 file changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_rlc.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_rlc.c
> index 35e0ae9acadc..2c3675d91614 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_rlc.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_rlc.c
> @@ -531,13 +531,12 @@ int amdgpu_gfx_rlc_init_microcode(struct
> amdgpu_device *adev,
>       if (version_major == 2 && version_minor == 1)
>               adev->gfx.rlc.is_rlc_v2_1 = true;
>
> -     if (version_minor >= 0) {
> -             err = amdgpu_gfx_rlc_init_microcode_v2_0(adev);
> -             if (err) {
> -                     dev_err(adev->dev, "fail to init rlc v2_0 microcode\n");
> -                     return err;
> -             }
> +     err = amdgpu_gfx_rlc_init_microcode_v2_0(adev);
> +     if (err) {
> +             dev_err(adev->dev, "fail to init rlc v2_0 microcode\n");
> +             return err;
>       }
> +
>       if (version_minor >= 1)
>               amdgpu_gfx_rlc_init_microcode_v2_1(adev);
>       if (version_minor >= 2)
> --
> 2.34.1

-------------- next part --------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 16030 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20231221/cdabc9c7/attachment-0001.bin>


More information about the amd-gfx mailing list