All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] staging: nvec: Avoid the use of BUG_ON
@ 2016-02-24 16:57 Laura Garcia Liebana
  2016-02-24 17:00 ` [Outreachy kernel] " Julia Lawall
  0 siblings, 1 reply; 2+ messages in thread
From: Laura Garcia Liebana @ 2016-02-24 16:57 UTC (permalink / raw)
  To: outreachy-kernel, devel

Prevent a kernel panic by avoiding the use of the BUG_ON macro.
Checkpatch detected this issue.

The WARN_ON macro is not needed as such cases shouldn't happen and they
were introduced for debugging purposes.

Signed-off-by: Laura Garcia Liebana <nevola@gmail.com>
---
Changes in v2:
	- According to Marc Dietrich, module creator, the WARN_ON macro is not needed as such cases shouldn't happen and they were introduced for debugging purposes.

Changes in v3:
	- Explanation of changes in v2 included in the commit message, as Fabio Estevam suggested.

 drivers/staging/nvec/nvec.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c
index c335ae2..f6a1dbb 100644
--- a/drivers/staging/nvec/nvec.c
+++ b/drivers/staging/nvec/nvec.c
@@ -641,11 +641,9 @@ static irqreturn_t nvec_interrupt(int irq, void *dev)
 			nvec_msg_free(nvec, nvec->rx);
 			nvec->state = 3;
 			nvec_tx_set(nvec);
-			BUG_ON(nvec->tx->size < 1);
 			to_send = nvec->tx->data[0];
 			nvec->tx->pos = 1;
 		} else if (status == (I2C_SL_IRQ)) {
-			BUG_ON(nvec->rx == NULL);
 			nvec->rx->data[1] = received;
 			nvec->rx->pos = 2;
 			nvec->state = 4;
-- 
2.7.0



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

* Re: [Outreachy kernel] [PATCH v3] staging: nvec: Avoid the use of BUG_ON
  2016-02-24 16:57 [PATCH v3] staging: nvec: Avoid the use of BUG_ON Laura Garcia Liebana
@ 2016-02-24 17:00 ` Julia Lawall
  0 siblings, 0 replies; 2+ messages in thread
From: Julia Lawall @ 2016-02-24 17:00 UTC (permalink / raw)
  To: Laura Garcia Liebana; +Cc: outreachy-kernel, devel

On Wed, 24 Feb 2016, Laura Garcia Liebana wrote:

> Prevent a kernel panic by avoiding the use of the BUG_ON macro.
> Checkpatch detected this issue.
>
> The WARN_ON macro is not needed as such cases shouldn't happen and they
> were introduced for debugging purposes.

Not sure to understand.  There is no use of WARN_ON.

julia

>
> Signed-off-by: Laura Garcia Liebana <nevola@gmail.com>
> ---
> Changes in v2:
> 	- According to Marc Dietrich, module creator, the WARN_ON macro is not needed as such cases shouldn't happen and they were introduced for debugging purposes.
>
> Changes in v3:
> 	- Explanation of changes in v2 included in the commit message, as Fabio Estevam suggested.
>
>  drivers/staging/nvec/nvec.c | 2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c
> index c335ae2..f6a1dbb 100644
> --- a/drivers/staging/nvec/nvec.c
> +++ b/drivers/staging/nvec/nvec.c
> @@ -641,11 +641,9 @@ static irqreturn_t nvec_interrupt(int irq, void *dev)
>  			nvec_msg_free(nvec, nvec->rx);
>  			nvec->state = 3;
>  			nvec_tx_set(nvec);
> -			BUG_ON(nvec->tx->size < 1);
>  			to_send = nvec->tx->data[0];
>  			nvec->tx->pos = 1;
>  		} else if (status == (I2C_SL_IRQ)) {
> -			BUG_ON(nvec->rx == NULL);
>  			nvec->rx->data[1] = received;
>  			nvec->rx->pos = 2;
>  			nvec->state = 4;
> --
> 2.7.0
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20160224165708.GA3517%40sonyv.
> For more options, visit https://groups.google.com/d/optout.
>


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

end of thread, other threads:[~2016-02-24 17:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-24 16:57 [PATCH v3] staging: nvec: Avoid the use of BUG_ON Laura Garcia Liebana
2016-02-24 17:00 ` [Outreachy kernel] " Julia Lawall

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.