diff mbox

drm/amdgpu/gfx8: fix bugon.cocci warnings

Message ID alpine.DEB.2.20.1701100650520.2185@hadrien (mailing list archive)
State New, archived
Headers show

Commit Message

Julia Lawall Jan. 10, 2017, 5:52 a.m. UTC
Use BUG_ON instead of a if condition followed by BUG.

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

CC: Xiangliang Yu <Xiangliang.Yu@amd.com>
Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

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

Comments

Christian König Jan. 10, 2017, 9:29 a.m. UTC | #1
Am 10.01.2017 um 06:52 schrieb Julia Lawall:
>   Use BUG_ON instead of a if condition followed by BUG.
>
> Generated by: scripts/coccinelle/misc/bugon.cocci
>
> CC: Xiangliang Yu <Xiangliang.Yu@amd.com>
> Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>

Reviewed-by: Christian König <christian.koenig@amd.com>.

> ---
>
>   gfx_v8_0.c |    3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
>
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> @@ -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));
Xiangliang Yu Jan. 10, 2017, 9:38 a.m. UTC | #2
>  Use BUG_ON instead of a if condition followed by BUG.
> 
> Generated by: scripts/coccinelle/misc/bugon.cocci
> 
> CC: Xiangliang Yu <Xiangliang.Yu@amd.com>
> Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
> ---
> 
>  gfx_v8_0.c |    3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> @@ -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));

Reviewd-by: Xiangliang.Yu <Xiangliang.Yu@amd.com>
Alex Deucher Jan. 12, 2017, 2:39 p.m. UTC | #3
On Tue, Jan 10, 2017 at 4:38 AM, Yu, Xiangliang <Xiangliang.Yu@amd.com> wrote:
>>  Use BUG_ON instead of a if condition followed by BUG.
>>
>> Generated by: scripts/coccinelle/misc/bugon.cocci
>>
>> CC: Xiangliang Yu <Xiangliang.Yu@amd.com>
>> Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
>> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>

Applied.  thanks!

Alex

>> ---
>>
>>  gfx_v8_0.c |    3 +--
>>  1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> --- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
>> @@ -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));
>
> Reviewd-by: Xiangliang.Yu <Xiangliang.Yu@amd.com>
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
diff mbox

Patch

--- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
@@ -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));