]> git.baikalelectronics.ru Git - kernel.git/commitdiff
amdgpu: remove unreachable code
authorJiapeng Chong <jiapeng.chong@linux.alibaba.com>
Fri, 28 May 2021 09:29:18 +0000 (17:29 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 2 Jun 2021 02:55:39 +0000 (22:55 -0400)
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.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c

index c6dbc08016045d3216fad0eebbf6b7435786e968..35f68748ad26f0b45ff55cb908ac77556966cadd 100644 (file)
@@ -829,9 +829,8 @@ 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;
 }