diff mbox

macvtap: fix bugon.cocci warnings

Message ID alpine.DEB.2.10.1606081814180.2890@hadrien
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

Julia Lawall June 8, 2016, 4:15 p.m. UTC
Use BUG_ON instead of a if condition followed by BUG.

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

CC: Mike Rapoport <rppt@linux.vnet.ibm.com>
Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

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

Comments

David Miller June 8, 2016, 6:30 p.m. UTC | #1
From: Julia Lawall <julia.lawall@lip6.fr>
Date: Wed, 8 Jun 2016 18:15:29 +0200 (CEST)

>  Use BUG_ON instead of a if condition followed by BUG.
> 
> Generated by: scripts/coccinelle/misc/bugon.cocci
> 
> CC: Mike Rapoport <rppt@linux.vnet.ibm.com>
> Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>

This doesn't apply cleanly to any of my trees.
Julia Lawall June 8, 2016, 8:59 p.m. UTC | #2
On Wed, 8 Jun 2016, David Miller wrote:

> From: Julia Lawall <julia.lawall@lip6.fr>
> Date: Wed, 8 Jun 2016 18:15:29 +0200 (CEST)
> 
> >  Use BUG_ON instead of a if condition followed by BUG.
> > 
> > Generated by: scripts/coccinelle/misc/bugon.cocci
> > 
> > CC: Mike Rapoport <rppt@linux.vnet.ibm.com>
> > Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
> > Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
> 
> This doesn't apply cleanly to any of my trees.

Sorry not to have included the source information.  It seems to be from 
here:

https://github.com/0day-ci/linux/commits/Mike-Rapoport/virtio_net-add-_UAPI-prefix-to-virtio_net-header-guards/20160608-211558

julia
diff mbox

Patch

--- a/drivers/net/macvtap.c
+++ b/drivers/net/macvtap.c
@@ -796,8 +796,7 @@  static ssize_t macvtap_put_user(struct m

 		ret = virtio_net_hdr_from_skb(skb, &vnet_hdr,
 					      macvtap_is_little_endian(q));
-		if (ret)
-			BUG();
+		BUG_ON(ret);

 		if (copy_to_iter(&vnet_hdr, sizeof(vnet_hdr), iter) !=
 		    sizeof(vnet_hdr))