Skip to contentSkip to conversation

drm/amdgpu/gfx8: fix bugon.cocci warnings

PATCH Applied Julia Lawall 4 participants 4 messages Jan 10, 2017 – Jan 12, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu/gfx8: fix bugon.cocci warnings

Use BUG_ON instead of a if condition followed by BUG.

Generated by: scripts/coccinelle/misc/bugon.cocci

---

 gfx_v8_0.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +1 -2
@@ -6623,8 +6623,7 @@ static void gfx_v8_0_ring_emit_fence_kiq
 					 u64 seq, unsigned int flags)
 {
 	/* we only allocate 32bit for each seq wb address */
-	if (flags & AMDGPU_FENCE_FLAG_64BIT)
-		BUG();
+	BUG_ON(flags & AMDGPU_FENCE_FLAG_64BIT);
 
 	/* write fence seq to the "addr" */
 	amdgpu_ring_write(ring, PACKET3(PACKET3_WRITE_DATA, 3));

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

maintainer Reviewed-by on v1 1/1
#1 lore raw

Am 10.01.2017 um 06:52 schrieb Julia Lawall:

Quoted 7 lines

Use BUG_ON instead of a if condition followed by BUG.

Generated by: scripts/coccinelle/misc/bugon.cocci

Quoted 8 lines

---

  gfx_v8_0.c |    3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)

drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c static void gfx_v8_0_ring_emit_fence_kiq · line 6629

Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +1 -2
@@ -6623,8 +6623,7 @@ static void gfx_v8_0_ring_emit_fence_kiq
  					 u64 seq, unsigned int flags)
  {
  	/* we only allocate 32bit for each seq wb address */
-	if (flags & AMDGPU_FENCE_FLAG_64BIT)
-		BUG();
+	BUG_ON(flags & AMDGPU_FENCE_FLAG_64BIT);
 
  	/* write fence seq to the "addr" */
  	amdgpu_ring_write(ring, PACKET3(PACKET3_WRITE_DATA, 3));

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#2 lore raw
In reply to Julia Lawall
Quoted 15 lines

Use BUG_ON instead of a if condition followed by BUG.

Generated by: scripts/coccinelle/misc/bugon.cocci

---

 gfx_v8_0.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c static void gfx_v8_0_ring_emit_fence_kiq · line 6629

Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +1 -2
@@ -6623,8 +6623,7 @@ static void gfx_v8_0_ring_emit_fence_kiq
 					 u64 seq, unsigned int flags)
 {
 	/* we only allocate 32bit for each seq wb address */
-	if (flags & AMDGPU_FENCE_FLAG_64BIT)
-		BUG();
+	BUG_ON(flags & AMDGPU_FENCE_FLAG_64BIT);
 
 	/* write fence seq to the "addr" */
 	amdgpu_ring_write(ring, PACKET3(PACKET3_WRITE_DATA, 3));

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Applied
#3 lore raw
Quoted 7 lines · Xiangliang
Quoted 7 lines

Use BUG_ON instead of a if condition followed by BUG.

Generated by: scripts/coccinelle/misc/bugon.cocci

Applied. thanks!

Alex

Quoted 20 lines
Quoted 8 lines

---

 gfx_v8_0.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c static void gfx_v8_0_ring_emit_fence_kiq · line 6629

Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +1 -2
@@ -6623,8 +6623,7 @@ static void gfx_v8_0_ring_emit_fence_kiq
                                       u64 seq, unsigned int flags)
 {
      /* we only allocate 32bit for each seq wb address */
-     if (flags & AMDGPU_FENCE_FLAG_64BIT)
-             BUG();
+     BUG_ON(flags & AMDGPU_FENCE_FLAG_64BIT);
 
      /* write fence seq to the "addr" */
      amdgpu_ring_write(ring, PACKET3(PACKET3_WRITE_DATA, 3));
Quoted 4 lines

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel