Commit 188d5b41 authored by Christian Gromm's avatar Christian Gromm Committed by Greg Kroah-Hartman

staging: most: usb: drop unlikely macros

This patch removes the unlikely macros in the error patch of argument
checking, as it has no measurable performance adavantage.
Signed-off-by: default avatarChristian Gromm <christian.gromm@microchip.com>
Reported-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/1588672829-28883-4-git-send-email-christian.gromm@microchip.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 441be56f
...@@ -233,7 +233,7 @@ static int hdm_poison_channel(struct most_interface *iface, int channel) ...@@ -233,7 +233,7 @@ static int hdm_poison_channel(struct most_interface *iface, int channel)
unsigned long flags; unsigned long flags;
spinlock_t *lock; /* temp. lock */ spinlock_t *lock; /* temp. lock */
if (unlikely(channel < 0 || channel >= iface->num_channels)) { if (channel < 0 || channel >= iface->num_channels) {
dev_warn(&mdev->usb_device->dev, "Channel ID out of range.\n"); dev_warn(&mdev->usb_device->dev, "Channel ID out of range.\n");
return -ECHRNG; return -ECHRNG;
} }
...@@ -555,9 +555,9 @@ static int hdm_enqueue(struct most_interface *iface, int channel, ...@@ -555,9 +555,9 @@ static int hdm_enqueue(struct most_interface *iface, int channel,
unsigned long length; unsigned long length;
void *virt_address; void *virt_address;
if (unlikely(!mbo)) if (!mbo)
return -EINVAL; return -EINVAL;
if (unlikely(iface->num_channels <= channel || channel < 0)) if (iface->num_channels <= channel || channel < 0)
return -ECHRNG; return -ECHRNG;
mdev = to_mdev(iface); mdev = to_mdev(iface);
...@@ -670,11 +670,11 @@ static int hdm_configure_channel(struct most_interface *iface, int channel, ...@@ -670,11 +670,11 @@ static int hdm_configure_channel(struct most_interface *iface, int channel,
mdev->clear_work[channel].mdev = mdev; mdev->clear_work[channel].mdev = mdev;
INIT_WORK(&mdev->clear_work[channel].ws, wq_clear_halt); INIT_WORK(&mdev->clear_work[channel].ws, wq_clear_halt);
if (unlikely(!conf)) { if (!conf) {
dev_err(dev, "Bad config pointer.\n"); dev_err(dev, "Bad config pointer.\n");
return -EINVAL; return -EINVAL;
} }
if (unlikely(channel < 0 || channel >= iface->num_channels)) { if (channel < 0 || channel >= iface->num_channels) {
dev_err(dev, "Channel ID out of range.\n"); dev_err(dev, "Channel ID out of range.\n");
return -EINVAL; return -EINVAL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment