mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Quytelda Kahja <quytelda@tamalin.org>
To: gregkh@linuxfoundation.org, dan.carpenter@oracle.com
Cc: devel@driverdev.osuosl.org, chris@engineersdelight.de,
	linux-kernel@vger.kernel.org, Michael.Fabry@microchip.com,
	christian.gromm@microchip.com,
	Quytelda Kahja <quytelda@tamalin.org>
Subject: [PATCH] staging: most: Remove unnecessary usage of BUG_ON().
Date: Tue,  6 Mar 2018 17:31:41 -0800	[thread overview]
Message-ID: <20180307013141.23080-1-quytelda@tamalin.org> (raw)
In-Reply-To: <20180306094728.xbhamhpwdphv6kju@mwanda>

There is no need for the calls to BUG_ON() in this driver, which are
used to check if mbo or mbo->context are NULL; mbo is never NULL, and
if mbo->context is NULL it would have already been dereferenced and
oopsed before reaching the BUG_ON().

Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
Acked-by: Christian Gromm <christian.gromm@microchip.com>
---
 drivers/staging/most/core.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/staging/most/core.c b/drivers/staging/most/core.c
index 0ab2de5ecf18..3afc25a61643 100644
--- a/drivers/staging/most/core.c
+++ b/drivers/staging/most/core.c
@@ -915,7 +915,6 @@ static void arm_mbo(struct mbo *mbo)
 	unsigned long flags;
 	struct most_channel *c;
 
-	BUG_ON((!mbo) || (!mbo->context));
 	c = mbo->context;
 
 	if (c->is_poisoned) {
@@ -1018,8 +1017,6 @@ static void most_write_completion(struct mbo *mbo)
 {
 	struct most_channel *c;
 
-	BUG_ON((!mbo) || (!mbo->context));
-
 	c = mbo->context;
 	if (mbo->status == MBO_E_INVAL)
 		pr_info("WARN: Tx MBO status: invalid\n");
-- 
2.16.2

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

  reply	other threads:[~2018-03-07  1:31 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-24  7:58 [PATCH 1/4] staging: most: Fix coding style problems Quytelda Kahja
2018-02-24  7:58 ` [PATCH 2/4] staging: most: Replace calls to BUG_ON() with WARN_ONCE() and return Quytelda Kahja
2018-03-01 16:21   ` Greg KH
2018-03-06  9:23     ` Quytelda Kahja
2018-03-06  9:47       ` Dan Carpenter
2018-03-07  1:31         ` Quytelda Kahja [this message]
2018-03-07  8:37           ` [PATCH] staging: most: Remove unnecessary usage of BUG_ON() Christian Gromm
2018-02-24  7:58 ` [PATCH 3/4] staging: most: Remove unnecessary OOM messages Quytelda Kahja
2018-02-24  7:58 ` [PATCH 4/4] staging: most: Fix missing identifier in function definition argument Quytelda Kahja
2018-03-01 16:20 ` [PATCH 1/4] staging: most: Fix coding style problems Greg KH
2018-03-02  2:11   ` [PATCH 1/2] staging: most: Fix a coding style problem Quytelda Kahja
2018-03-02  2:11     ` [PATCH 2/2] " Quytelda Kahja
2018-03-02 10:12       ` Dan Carpenter
2018-03-06  9:18         ` [PATCH v2 1/2] staging: most: Add a blank line Quytelda Kahja
2018-03-06  9:34         ` [PATCH v2 2/2] staging: most: Indent function parameter Quytelda Kahja

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=20180307013141.23080-1-quytelda@tamalin.org \
    --to=quytelda@tamalin.org \
    --cc=Michael.Fabry@microchip.com \
    --cc=chris@engineersdelight.de \
    --cc=christian.gromm@microchip.com \
    --cc=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®