summaryrefslogtreecommitdiffstats
path: root/drivers/media/usb
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2014-09-22 04:58:53 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2014-09-23 16:13:44 -0300
commit271430efb21223e9654fcae58955305c5f70663b (patch)
tree6cb560ad0b53ee51a758756e3bfcc2436777ae45 /drivers/media/usb
parent146af9cb809c6b6a0f4e215570fb3f397cd55a21 (diff)
downloadop-kernel-dev-271430efb21223e9654fcae58955305c5f70663b.zip
op-kernel-dev-271430efb21223e9654fcae58955305c5f70663b.tar.gz
[media] as102: remove some unneeded checks
We know "ret" is zero so we don't need to test for it. It upsets the static checkers when we test stuff but we know the answer. drivers/media/usb/as102/as102_usb_drv.c:164 as102_send_ep1() warn: we tested 'ret' before and it was 'false' drivers/media/usb/as102/as102_usb_drv.c:189 as102_read_ep2() warn: we tested 'ret' before and it was 'false' Also, we don't need to initialize "ret". Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/usb')
-rw-r--r--drivers/media/usb/as102/as102_usb_drv.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/media/usb/as102/as102_usb_drv.c b/drivers/media/usb/as102/as102_usb_drv.c
index 43133df..3f66906 100644
--- a/drivers/media/usb/as102/as102_usb_drv.c
+++ b/drivers/media/usb/as102/as102_usb_drv.c
@@ -145,7 +145,7 @@ static int as102_send_ep1(struct as10x_bus_adapter_t *bus_adap,
int send_buf_len,
int swap32)
{
- int ret = 0, actual_len;
+ int ret, actual_len;
ret = usb_bulk_msg(bus_adap->usb_dev,
usb_sndbulkpipe(bus_adap->usb_dev, 1),
@@ -161,13 +161,13 @@ static int as102_send_ep1(struct as10x_bus_adapter_t *bus_adap,
actual_len, send_buf_len);
return -1;
}
- return ret ? ret : actual_len;
+ return actual_len;
}
static int as102_read_ep2(struct as10x_bus_adapter_t *bus_adap,
unsigned char *recv_buf, int recv_buf_len)
{
- int ret = 0, actual_len;
+ int ret, actual_len;
if (recv_buf == NULL)
return -EINVAL;
@@ -186,7 +186,7 @@ static int as102_read_ep2(struct as10x_bus_adapter_t *bus_adap,
actual_len, recv_buf_len);
return -1;
}
- return ret ? ret : actual_len;
+ return actual_len;
}
static struct as102_priv_ops_t as102_priv_ops = {
OpenPOWER on IntegriCloud