drm/amdgpu/vcn: fix unitialized variable warnings
Subsystems (2)
PATCH v2 1/1 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 <[email protected]>
Reviewed-by Alex Deucher <[email protected]>
Signed-off-by Pierre-Eric Pelloux-Prayer <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 1 + drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c | 1 + drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c | 1 + drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c | 1 + 4 files changed, 4 insertions(+)
drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c +1 -0
@@ -359,6 +359,7 @@ static int vcn_v3_0_hw_init(void *handle) } } +return 0 ; done:if (!r) DRM_INFO("VCN decode and encode initialized successfully(under %s).\n",
drivers/gpu/drm/amd/amdgpu/vcn_v4_0.c +1 -0
@@ -288,6 +288,7 @@ static int vcn_v4_0_hw_init(void *handle) } } +return 0 ; done:if (!r) DRM_INFO("VCN decode and encode initialized successfully(under %s).\n",
drivers/gpu/drm/amd/amdgpu/vcn_v4_0_5.c +1 -0
@@ -237,6 +237,7 @@ static int vcn_v4_0_5_hw_init(void *handle) goto done; } +return 0 ; done:if (!r) DRM_INFO("VCN decode and encode initialized successfully(under %s).\n",
drivers/gpu/drm/amd/amdgpu/vcn_v5_0_0.c +1 -0
@@ -203,6 +203,7 @@ static int vcn_v5_0_0_hw_init(void *handle) goto done; } +return 0 ; done:if (!r) DRM_INFO("VCN decode and encode initialized successfully(under %s).\n",
Signature · 1 line
2.41.0