drm/amdgpu: remove unreachable code
Subsystems (3)
PATCH 1/1 drm/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.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 2 -- 1 file changed, 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +0 -2
@@ -842,8 +842,6 @@ static int amdgpu_uvd_cs_msg(struct amdgpu_uvd_cs_ctx *ctx,DRM_ERROR ("Illegal UVD message type (%d)!\n" , msg_type);return -EINVAL ; } -BUG (); -return -EINVAL ; }/**
Signature · 1 line
1.8.3.1
Alex Deucher
AppliedApplied. Thanks!
Alex
Quoted 30 lines · Jiapeng Chong
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]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 2 -- 1 file changed, 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +0
-3@@ -842,8 +842,6 @@ static int amdgpu_uvd_cs_msg(struct amdgpu_uvd_cs_ctx *ctx,DRM_ERROR ("Illegal UVD message type (%d)!\n" , msg_type);return -EINVAL ; } -BUG (); -return -EINVAL ; }/** --
Quoted 2 lines
1.8.3.1
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Am 24.05.21 um 20:48 schrieb Alex Deucher:
Quoted 1 line
Applied. Thanks!
Ok, that's unfortunate.
IIRC we added the code because of a different compiler warning.
Christian.
Quoted 40 lines
Alex
Quoted 29 lines · Jiapeng Chong
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]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 2 -- 1 file changed, 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +0
-3@@ -842,8 +842,6 @@ static int amdgpu_uvd_cs_msg(struct amdgpu_uvd_cs_ctx *ctx,DRM_ERROR ("Illegal UVD message type (%d)!\n" , msg_type);return -EINVAL ; } -BUG (); -return -EINVAL ; }/** -- Quoted 2 lines
1.8.3.1
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 8 lines · Christian König
Am 24.05.21 um 20:48 schrieb Alex Deucher:
Quoted 1 line
Applied. Thanks!
Ok, that's unfortunate.
IIRC we added the code because of a different compiler warning.
I can revert it.
Alex
Quoted 43 lines
Christian.
Quoted 40 lines
Alex
Quoted 29 lines · Jiapeng Chong
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]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 2 -- 1 file changed, 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +0
-3@@ -842,8 +842,6 @@ static int amdgpu_uvd_cs_msg(struct amdgpu_uvd_cs_ctx *ctx,DRM_ERROR ("Illegal UVD message type (%d)!\n" , msg_type);return -EINVAL ; } -BUG (); -return -EINVAL ; }/** -- Quoted 2 lines
1.8.3.1
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Christian König
maintainerAm 24.05.21 um 12:46 schrieb Jiapeng Chong:
Quoted 8 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.
Mhm, that is a NAK. IIRC we explicitely added that code because some compiler versions complained that we don't return a value at the end of the function.
I suggest to drop the return from the default case and the BUG() instead.
Regards,
Christian.
Quoted 20 lines
Reported-by Abaci Robot <[email protected]>Signed-off-by Jiapeng Chong <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 2 -- 1 file changed, 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +0
-2@@ -842,8 +842,6 @@ static int amdgpu_uvd_cs_msg(struct amdgpu_uvd_cs_ctx *ctx,DRM_ERROR ("Illegal UVD message type (%d)!\n" , msg_type);return -EINVAL ; } -BUG (); -return -EINVAL ; }/**