All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laura Garcia Liebana <nevola@gmail.com>
To: outreachy-kernel@googlegroups.com, devel@linuxdriverproject.org
Subject: [PATCH v3] staging: nvec: Avoid the use of BUG_ON
Date: Wed, 24 Feb 2016 17:57:30 +0100	[thread overview]
Message-ID: <20160224165708.GA3517@sonyv> (raw)

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



             reply	other threads:[~2016-02-24 16:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-24 16:57 Laura Garcia Liebana [this message]
2016-02-24 17:00 ` [Outreachy kernel] [PATCH v3] staging: nvec: Avoid the use of BUG_ON Julia Lawall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160224165708.GA3517@sonyv \
    --to=nevola@gmail.com \
    --cc=devel@linuxdriverproject.org \
    --cc=outreachy-kernel@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.