From: Quytelda Kahja Date: Wed, 7 Mar 2018 01:31:41 +0000 (-0800) Subject: staging: most: Remove unnecessary usage of BUG_ON(). X-Git-Tag: for-linus-20180413~40^2~216 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=c92e677b20fa389e9e81e21fa96e4520a5fd0ba5;p=linux-2.6-block.git staging: most: Remove unnecessary usage of BUG_ON(). 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 Acked-by: Christian Gromm Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/most/core.c b/drivers/staging/most/core.c index 8d311970225e..8f2833526f7f 100644 --- a/drivers/staging/most/core.c +++ b/drivers/staging/most/core.c @@ -916,7 +916,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) { @@ -1019,8 +1018,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");