drm/amdgpu/vcn: fix unitialized variable warnings
authorPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Thu, 18 Apr 2024 18:06:08 +0000 (20:06 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 23 Apr 2024 16:08:30 +0000 (12:08 -0400)
commit6e042cee748fb353d510eec2938591a995db3401
tree9bfb713a9e5dfffa497d95f554452bb33fbe17fb
parent3f0664110a40033785e7fed56ed2e4287b14c1f9
drm/amdgpu/vcn: fix unitialized variable warnings

Avoid returning an uninitialized value if we never enter the loop.
This case should never be hit in practice, but returning 0 doesn't
hurt.

The same fix is applied to the 4 places using the same pattern.

v2: - fixed typos in commit message (Alex)
    - use "return 0;" before the done label instead of initializing
      r to 0

Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c
drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c
drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c
drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c