AMD-GFX Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH][next] drm: amdgpu: fix premature goto because of missing braces
@ 2020-06-24 14:14 Colin King
  2020-06-24 14:33 ` Nirmoy
  0 siblings, 1 reply; 3+ messages in thread
From: Colin King @ 2020-06-24 14:14 UTC (permalink / raw)
  To: Alex Deucher, Christian König, David Airlie, Daniel Vetter,
	Nirmoy Das, Sonny Jiang, amd-gfx, dri-devel
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Currently the goto statement is skipping over a lot of setup code
because it is outside of an if-block and should be inside it. Fix
this by adding missing if statement braces.

Addresses-Coverity: ("Structurally dead code")
Fixes: fd151ca5396d ("drm amdgpu: SI UVD v3_1")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c b/drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c
index 599719e89c31..7cf4b11a65c5 100644
--- a/drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c
+++ b/drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c
@@ -642,9 +642,10 @@ static int uvd_v3_1_hw_init(void *handle)
 	uvd_v3_1_start(adev);
 
 	r = amdgpu_ring_test_helper(ring);
-	if (r)
+	if (r) {
 		DRM_ERROR("amdgpu: UVD ring test fail (%d).\n", r);
-	goto done;
+		goto done;
+	}
 
 	r = amdgpu_ring_alloc(ring, 10);
 	if (r) {
-- 
2.27.0

_______________________________________________
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

* Re: [PATCH][next] drm: amdgpu: fix premature goto because of missing braces
  2020-06-24 14:14 [PATCH][next] drm: amdgpu: fix premature goto because of missing braces Colin King
@ 2020-06-24 14:33 ` Nirmoy
  2020-06-24 15:11   ` Alex Deucher
  0 siblings, 1 reply; 3+ messages in thread
From: Nirmoy @ 2020-06-24 14:33 UTC (permalink / raw)
  To: Colin King, Alex Deucher, Christian König, David Airlie,
	Daniel Vetter, Nirmoy Das, Sonny Jiang, amd-gfx, dri-devel
  Cc: kernel-janitors, linux-kernel

Acked-by: Nirmoy Das <nirmoy.das@amd.com>


Thanks,

Nirmoy

On 6/24/20 4:14 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Currently the goto statement is skipping over a lot of setup code
> because it is outside of an if-block and should be inside it. Fix
> this by adding missing if statement braces.
>
> Addresses-Coverity: ("Structurally dead code")
> Fixes: fd151ca5396d ("drm amdgpu: SI UVD v3_1")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c b/drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c
> index 599719e89c31..7cf4b11a65c5 100644
> --- a/drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c
> +++ b/drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c
> @@ -642,9 +642,10 @@ static int uvd_v3_1_hw_init(void *handle)
>   	uvd_v3_1_start(adev);
>   
>   	r = amdgpu_ring_test_helper(ring);
> -	if (r)
> +	if (r) {
>   		DRM_ERROR("amdgpu: UVD ring test fail (%d).\n", r);
> -	goto done;
> +		goto done;
> +	}
>   
>   	r = amdgpu_ring_alloc(ring, 10);
>   	if (r) {
_______________________________________________
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

* Re: [PATCH][next] drm: amdgpu: fix premature goto because of missing braces
  2020-06-24 14:33 ` Nirmoy
@ 2020-06-24 15:11   ` Alex Deucher
  0 siblings, 0 replies; 3+ messages in thread
From: Alex Deucher @ 2020-06-24 15:11 UTC (permalink / raw)
  To: Nirmoy
  Cc: David Airlie, kernel-janitors, LKML, amd-gfx list, Sonny Jiang,
	Nirmoy Das, Maling list - DRI developers, Daniel Vetter,
	Alex Deucher, Colin King, Christian König

Applied.  Thanks!

Alex

On Wed, Jun 24, 2020 at 10:32 AM Nirmoy <nirmodas@amd.com> wrote:
>
> Acked-by: Nirmoy Das <nirmoy.das@amd.com>
>
>
> Thanks,
>
> Nirmoy
>
> On 6/24/20 4:14 PM, Colin King wrote:
> > From: Colin Ian King <colin.king@canonical.com>
> >
> > Currently the goto statement is skipping over a lot of setup code
> > because it is outside of an if-block and should be inside it. Fix
> > this by adding missing if statement braces.
> >
> > Addresses-Coverity: ("Structurally dead code")
> > Fixes: fd151ca5396d ("drm amdgpu: SI UVD v3_1")
> > Signed-off-by: Colin Ian King <colin.king@canonical.com>
> > ---
> >   drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c | 5 +++--
> >   1 file changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c b/drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c
> > index 599719e89c31..7cf4b11a65c5 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/uvd_v3_1.c
> > @@ -642,9 +642,10 @@ static int uvd_v3_1_hw_init(void *handle)
> >       uvd_v3_1_start(adev);
> >
> >       r = amdgpu_ring_test_helper(ring);
> > -     if (r)
> > +     if (r) {
> >               DRM_ERROR("amdgpu: UVD ring test fail (%d).\n", r);
> > -     goto done;
> > +             goto done;
> > +     }
> >
> >       r = amdgpu_ring_alloc(ring, 10);
> >       if (r) {
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
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, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-24 14:14 [PATCH][next] drm: amdgpu: fix premature goto because of missing braces Colin King
2020-06-24 14:33 ` Nirmoy
2020-06-24 15:11   ` Alex Deucher

AMD-GFX Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/amd-gfx/0 amd-gfx/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 amd-gfx amd-gfx/ https://lore.kernel.org/amd-gfx \
		amd-gfx@lists.freedesktop.org
	public-inbox-index amd-gfx

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.freedesktop.lists.amd-gfx


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git