drm/amdgpu: Fix uninitialized variable in gfxhub_v1_2_xcp_resume
authorSrinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Fri, 19 May 2023 04:55:28 +0000 (10:25 +0530)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 9 Jun 2023 14:44:30 +0000 (10:44 -0400)
commit1893549af62135c788a66e7ff27c81459c532fb2
tree755969a0700798b1178c3e62d4e9b30c62ec0008
parent40e39d72277fc014e7b8149def35831998c8df2f
drm/amdgpu: Fix uninitialized variable in gfxhub_v1_2_xcp_resume

drivers/gpu/drm/amd/amdgpu/gfxhub_v1_2.c:657:6: error: variable 'ret' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
        if (!amdgpu_sriov_vf(adev))
            ^~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/gfxhub_v1_2.c:660:9: note: uninitialized use occurs here
        return ret;
               ^~~
drivers/gpu/drm/amd/amdgpu/gfxhub_v1_2.c:657:2: note: remove the 'if' if its condition is always true
        if (!amdgpu_sriov_vf(adev))
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/gfxhub_v1_2.c:648:9: note: initialize the variable 'ret' to silence this warning
        int ret;
               ^
                = 0
1 error generated.

Cc: Luben Tuikov <luben.tuikov@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Lijo Lazar <lijo.lazar@amd.com>
Cc: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/gfxhub_v1_2.c