summaryrefslogtreecommitdiffstats
path: root/drivers/staging/most/mostcore/core.c
diff options
context:
space:
mode:
authorChristian Gromm <christian.gromm@microchip.com>2016-09-21 14:49:05 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-09-22 11:54:46 +0200
commita6f9d846cc0980ef85ba9a2c863cef2f6202ac83 (patch)
treebd1db62cbb8a8924050af9ca29974c7e3bb50d01 /drivers/staging/most/mostcore/core.c
parent95842bc9fd03e51e4fa370c40542e2306d079699 (diff)
downloadlinux-stable-a6f9d846cc0980ef85ba9a2c863cef2f6202ac83.tar.gz
linux-stable-a6f9d846cc0980ef85ba9a2c863cef2f6202ac83.tar.bz2
linux-stable-a6f9d846cc0980ef85ba9a2c863cef2f6202ac83.zip
staging: most: make function most_submit_mbo return void
Function most_submit_mbo() causes an exception only if either the pointer mbo or mbo->context equals NULL. From the underlying architecture's point of view both cases must _not_ come true and would happen only, if something has tampered with the pointers. This would render runtime code unable to recover anyway. So, instead trying to hide that things are already critically out of control we're better off with a WARN_ON() assertion. This patch replaces the return type of the function most_submit_mbo() with 'void' and adds a WARN_ONCE() assertion. Additionally, code calling the function is adapted accordingly. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/most/mostcore/core.c')
-rw-r--r--drivers/staging/most/mostcore/core.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/staging/most/mostcore/core.c b/drivers/staging/most/mostcore/core.c
index bd555ecfe0b9..5f05a13157f7 100644
--- a/drivers/staging/most/mostcore/core.c
+++ b/drivers/staging/most/mostcore/core.c
@@ -1323,17 +1323,14 @@ _exit:
/**
* most_submit_mbo - submits an MBO to fifo
* @mbo: pointer to the MBO
- *
*/
-int most_submit_mbo(struct mbo *mbo)
+void most_submit_mbo(struct mbo *mbo)
{
- if (unlikely((!mbo) || (!mbo->context))) {
- pr_err("Bad MBO or missing channel reference\n");
- return -EINVAL;
- }
+ if (WARN_ONCE(!mbo || !mbo->context,
+ "bad mbo or missing channel reference\n"))
+ return;
nq_hdm_mbo(mbo);
- return 0;
}
EXPORT_SYMBOL_GPL(most_submit_mbo);