netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] vmxnet3: convert BUG_ON(true) into a simple BUG()
@ 2012-11-08 20:23 Sasha Levin
  2012-11-09  6:02 ` Shreyas Bhatewara
  2012-11-11 22:27 ` Ryan Mallon
  0 siblings, 2 replies; 4+ messages in thread
From: Sasha Levin @ 2012-11-08 20:23 UTC (permalink / raw)
  To: linux-kernel; +Cc: Sasha Levin, Shreyas Bhatewara, VMware, Inc., netdev

Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 drivers/net/vmxnet3/vmxnet3_drv.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c
index 0ae1bcc..7e9622f 100644
--- a/drivers/net/vmxnet3/vmxnet3_drv.c
+++ b/drivers/net/vmxnet3/vmxnet3_drv.c
@@ -1922,7 +1922,7 @@ vmxnet3_free_irqs(struct vmxnet3_adapter *adapter)
 		free_irq(adapter->pdev->irq, adapter->netdev);
 		break;
 	default:
-		BUG_ON(true);
+		BUG();
 	}
 }
 
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] vmxnet3: convert BUG_ON(true) into a simple BUG()
  2012-11-08 20:23 [PATCH] vmxnet3: convert BUG_ON(true) into a simple BUG() Sasha Levin
@ 2012-11-09  6:02 ` Shreyas Bhatewara
  2012-11-09 22:03   ` David Miller
  2012-11-11 22:27 ` Ryan Mallon
  1 sibling, 1 reply; 4+ messages in thread
From: Shreyas Bhatewara @ 2012-11-09  6:02 UTC (permalink / raw)
  To: Sasha Levin; +Cc: VMware, Inc., netdev, linux-kernel


----- Original Message -----
> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
> ---
>  drivers/net/vmxnet3/vmxnet3_drv.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Signed-off-by: Shreyas N Bhatewara <sbhatewara@vmware.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] vmxnet3: convert BUG_ON(true) into a simple BUG()
  2012-11-09  6:02 ` Shreyas Bhatewara
@ 2012-11-09 22:03   ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2012-11-09 22:03 UTC (permalink / raw)
  To: sbhatewara; +Cc: sasha.levin, pv-drivers, netdev, linux-kernel

From: Shreyas Bhatewara <sbhatewara@vmware.com>
Date: Thu, 8 Nov 2012 22:02:16 -0800 (PST)

> 
> ----- Original Message -----
>> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
>> ---
>>  drivers/net/vmxnet3/vmxnet3_drv.c |    2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Signed-off-by: Shreyas N Bhatewara <sbhatewara@vmware.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] vmxnet3: convert BUG_ON(true) into a simple BUG()
  2012-11-08 20:23 [PATCH] vmxnet3: convert BUG_ON(true) into a simple BUG() Sasha Levin
  2012-11-09  6:02 ` Shreyas Bhatewara
@ 2012-11-11 22:27 ` Ryan Mallon
  1 sibling, 0 replies; 4+ messages in thread
From: Ryan Mallon @ 2012-11-11 22:27 UTC (permalink / raw)
  To: Sasha Levin; +Cc: linux-kernel, Shreyas Bhatewara, VMware, Inc., netdev

On 09/11/12 07:23, Sasha Levin wrote:
> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
> ---
>  drivers/net/vmxnet3/vmxnet3_drv.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c
> index 0ae1bcc..7e9622f 100644
> --- a/drivers/net/vmxnet3/vmxnet3_drv.c
> +++ b/drivers/net/vmxnet3/vmxnet3_drv.c
> @@ -1922,7 +1922,7 @@ vmxnet3_free_irqs(struct vmxnet3_adapter *adapter)
>  		free_irq(adapter->pdev->irq, adapter->netdev);
>  		break;
>  	default:
> -		BUG_ON(true);
> +		BUG();
>  	}
>  }

All of the BUG_ON tests in this function look like programming error
assertions. It looks like the worst that would happen is that some irqs
might not be properly released, not the sort of thing that is going to
make the system unstable if you don't bug.

Can't they just be replaced with (for example):

	if (WARN_ON(blah))
		return;

Or even just:

	netdev_err(adapter->netdev, "bad irq type %d for free\n",
			intr->type);

~Ryan

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-11-11 22:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-08 20:23 [PATCH] vmxnet3: convert BUG_ON(true) into a simple BUG() Sasha Levin
2012-11-09  6:02 ` Shreyas Bhatewara
2012-11-09 22:03   ` David Miller
2012-11-11 22:27 ` Ryan Mallon

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).