* [PATCH v3] amdgpu: remove unreachable code
@ 2021-05-28 9:29 Jiapeng Chong
2021-05-28 12:18 ` Christian König
0 siblings, 1 reply; 3+ messages in thread
From: Jiapeng Chong @ 2021-05-28 9:29 UTC (permalink / raw)
To: alexander.deucher
Cc: Jiapeng Chong, airlied, linux-kernel, dri-devel, linaro-mm-sig,
amd-gfx, christian.koenig, linux-media
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>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
Changes in v2:
-For the follow advice: https://lore.kernel.org/patchwork/patch/1435968/
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
index c6dbc08..35f6874 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
@@ -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;
}
--
1.8.3.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v3] amdgpu: remove unreachable code
2021-05-28 9:29 [PATCH v3] amdgpu: remove unreachable code Jiapeng Chong
@ 2021-05-28 12:18 ` Christian König
2021-06-02 1:57 ` Alex Deucher
0 siblings, 1 reply; 3+ messages in thread
From: Christian König @ 2021-05-28 12:18 UTC (permalink / raw)
To: Jiapeng Chong, alexander.deucher
Cc: airlied, linux-kernel, dri-devel, linaro-mm-sig, amd-gfx, linux-media
Am 28.05.21 um 11:29 schrieb 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:845 amdgpu_uvd_cs_msg() warn:
> ignoring unreachable code.
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
> ---
> Changes in v2:
> -For the follow advice: https://lore.kernel.org/patchwork/patch/1435968/
>
> drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
> index c6dbc08..35f6874 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
> @@ -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;
> }
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v3] amdgpu: remove unreachable code
2021-05-28 12:18 ` Christian König
@ 2021-06-02 1:57 ` Alex Deucher
0 siblings, 0 replies; 3+ messages in thread
From: Alex Deucher @ 2021-06-02 1:57 UTC (permalink / raw)
To: Christian König
Cc: Jiapeng Chong, Dave Airlie, LKML, Maling list - DRI developers,
moderated list:DMA BUFFER SHARING FRAMEWORK, amd-gfx list,
Deucher, Alexander, linux-media
Applied. Thanks!
On Fri, May 28, 2021 at 8:18 AM Christian König
<christian.koenig@amd.com> wrote:
>
> Am 28.05.21 um 11:29 schrieb 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:845 amdgpu_uvd_cs_msg() warn:
> > ignoring unreachable code.
> >
> > Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> > Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
>
> Reviewed-by: Christian König <christian.koenig@amd.com>
>
> > ---
> > Changes in v2:
> > -For the follow advice: https://lore.kernel.org/patchwork/patch/1435968/
> >
> > drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 3 +--
> > 1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
> > index c6dbc08..35f6874 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c
> > @@ -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;
> > }
> >
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-06-02 1:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-28 9:29 [PATCH v3] amdgpu: remove unreachable code Jiapeng Chong
2021-05-28 12:18 ` Christian König
2021-06-02 1:57 ` Alex Deucher
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).