summaryrefslogtreecommitdiffstats
path: root/drivers/staging/most
diff options
context:
space:
mode:
authorChristian Gromm <christian.gromm@microchip.com>2020-05-05 12:00:26 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-05-05 12:17:58 +0200
commit3e8621aba71ad7b381699cf5119a779bc61e341d (patch)
tree6ee4dea6570755ebadf4dee2a612cc4dfd245ab1 /drivers/staging/most
parentd97a9d7aea04574959178557fa4c34efed64655a (diff)
downloadlinux-3e8621aba71ad7b381699cf5119a779bc61e341d.tar.bz2
staging: most: usb: remove overcautious parameter checking
The interface pointer passed to a core API function cannot be NULL. This patch removes unnessecary the sanity check of the pointer. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Link: https://lore.kernel.org/r/1588672829-28883-2-git-send-email-christian.gromm@microchip.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/most')
-rw-r--r--drivers/staging/most/usb/usb.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/staging/most/usb/usb.c b/drivers/staging/most/usb/usb.c
index e8c5a8c98375..9527e3162516 100644
--- a/drivers/staging/most/usb/usb.c
+++ b/drivers/staging/most/usb/usb.c
@@ -233,10 +233,6 @@ static int hdm_poison_channel(struct most_interface *iface, int channel)
unsigned long flags;
spinlock_t *lock; /* temp. lock */
- if (unlikely(!iface)) {
- dev_warn(&mdev->usb_device->dev, "Poison: Bad interface.\n");
- return -EIO;
- }
if (unlikely(channel < 0 || channel >= iface->num_channels)) {
dev_warn(&mdev->usb_device->dev, "Channel ID out of range.\n");
return -ECHRNG;
@@ -559,7 +555,7 @@ static int hdm_enqueue(struct most_interface *iface, int channel,
unsigned long length;
void *virt_address;
- if (unlikely(!iface || !mbo))
+ if (unlikely(!mbo))
return -EIO;
if (unlikely(iface->num_channels <= channel || channel < 0))
return -ECHRNG;
@@ -674,8 +670,8 @@ static int hdm_configure_channel(struct most_interface *iface, int channel,
mdev->clear_work[channel].mdev = mdev;
INIT_WORK(&mdev->clear_work[channel].ws, wq_clear_halt);
- if (unlikely(!iface || !conf)) {
- dev_err(dev, "Bad interface or config pointer.\n");
+ if (unlikely(!conf)) {
+ dev_err(dev, "Bad config pointer.\n");
return -EINVAL;
}
if (unlikely(channel < 0 || channel >= iface->num_channels)) {
@@ -747,7 +743,6 @@ static void hdm_request_netinfo(struct most_interface *iface, int channel,
{
struct most_dev *mdev;
- BUG_ON(!iface);
mdev = to_mdev(iface);
mdev->on_netinfo = on_netinfo;
if (!on_netinfo)