staging: nvec: Avoid the use of BUG_ON
PATCH v3 1/1 staging: nvec: Avoid the use of BUG_ON
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.
---
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(-)
drivers/staging/nvec/nvec.c +0 -2
@@ -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 ;
Signature · 1 line
2.7.0
Quoted 5 lines · Laura Garcia Liebana
Prevent a kernel panic by avoiding the use of the
BUG_ONmacro. Checkpatch detected this issue.The
WARN_ONmacro 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
Quoted 38 lines
Signed-off-by Laura Garcia Liebana <[email protected]>---
Changes in v2:
- According to Marc Dietrich, module creator, theWARN_ONmacro 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(-)drivers/staging/nvec/nvec.c +0
-3@@ -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 [email protected]. To post to this group, send email to [email protected].
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.