summaryrefslogtreecommitdiffstats
path: root/drivers/staging/dwc2
diff options
context:
space:
mode:
authorRashika Kheria <rashika.kheria@gmail.com>2013-10-26 23:11:22 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-10-28 14:54:49 -0700
commitbb6c3422c41274e7d36cb479ded104368687da9b (patch)
tree52c10e999ba3bce7d6f975d5be8846f9ca4aa8ac /drivers/staging/dwc2
parent1f74c04d224a2885974c62ff425e422a54579c36 (diff)
downloadlinux-bb6c3422c41274e7d36cb479ded104368687da9b.tar.gz
linux-bb6c3422c41274e7d36cb479ded104368687da9b.tar.bz2
linux-bb6c3422c41274e7d36cb479ded104368687da9b.zip
Staging: dwc2: Fix conditional statement since urb->actual_length is never less than zero.
This patch fixes the following smatch warning in hcd.c: drivers/staging/dwc2/hcd.c:787 dwc2_assign_and_init_hc() warn: unsigned 'urb->actual_length' is never less than zero. Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/dwc2')
-rw-r--r--drivers/staging/dwc2/hcd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/dwc2/hcd.c b/drivers/staging/dwc2/hcd.c
index 83629d84155d..3cfd2d5152c9 100644
--- a/drivers/staging/dwc2/hcd.c
+++ b/drivers/staging/dwc2/hcd.c
@@ -784,8 +784,8 @@ static int dwc2_assign_and_init_hc(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh)
chan->data_pid_start = qh->data_toggle;
chan->multi_count = 1;
- if ((urb->actual_length < 0 || urb->actual_length > urb->length) &&
- !dwc2_hcd_is_pipe_in(&urb->pipe_info))
+ if (urb->actual_length > urb->length &&
+ !dwc2_hcd_is_pipe_in(&urb->pipe_info))
urb->actual_length = urb->length;
if (hsotg->core_params->dma_enable > 0) {