amdgpu: remove unreachable code
Subsystems (3)
PATCH v2 1/1 amdgpu: remove unreachable code
In the function amdgpu_uvd_cs_msg(), every branch in the switch statement will have a return, so the code below the switch statement will not be executed.
Eliminate the follow smatch warning:
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c:845 amdgpu_uvd_cs_msg() warn:
ignoring unreachable code.
---
Changes in v2:
-For the follow advice: https://lore.kernel.org/patchwork/patch/1435074/
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 1 - 1 file changed, 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +0 -1
@@ -840,7 +840,6 @@ static int amdgpu_uvd_cs_msg(struct amdgpu_uvd_cs_ctx *ctx,default :DRM_ERROR ("Illegal UVD message type (%d)!\n" , msg_type); -return -EINVAL ; }BUG ();return -EINVAL ;
Signature · 1 line
1.8.3.1
Am 25.05.21 um 12:40 schrieb Jiapeng Chong:
Quoted 23 lines
In the function
amdgpu_uvd_cs_msg(), every branch in the switch statement will have a return, so the code below the switch statement will not be executed.Eliminate the follow smatch warning:
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c:845amdgpu_uvd_cs_msg()warn:
ignoring unreachable code.Reported-by Abaci Robot <[email protected]>Signed-off-by Jiapeng Chong <[email protected]>---
Changes in v2:
-For the follow advice: https://lore.kernel.org/patchwork/patch/1435074/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 1 - 1 file changed, 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +0
-0
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c static int amdgpu_uvd_cs_msg(struct amdgpu_uvd_cs_ctx *ctx, · line 844
Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +0
-1@@ -840,7 +840,6 @@ static int amdgpu_uvd_cs_msg(struct amdgpu_uvd_cs_ctx *ctx,default :DRM_ERROR ("Illegal UVD message type (%d)!\n" , msg_type); -return -EINVAL ; }BUG ();
You also need to remove the BUG() here or otherwise that will crash on an relatively harmless error.
Christian.
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c static int amdgpu_uvd_cs_msg(struct amdgpu_uvd_cs_ctx *ctx, · line 845
Quoted 1 line
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +0
-0return -EINVAL ;
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx