summaryrefslogtreecommitdiffstats
path: root/drivers/media/usb/au0828/au0828-dvb.c
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2015-12-28 19:52:48 -0200
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-02-01 07:39:25 -0200
commit80c1bce9aa315ac70738f79afb4f7c93ae27d9fa (patch)
tree4a582aa128bf96adacb18deb227208736c975ec4 /drivers/media/usb/au0828/au0828-dvb.c
parent490ba9c29d5b82df2bed59d6007314c03d597716 (diff)
downloadblackbird-obmc-linux-80c1bce9aa315ac70738f79afb4f7c93ae27d9fa.tar.gz
blackbird-obmc-linux-80c1bce9aa315ac70738f79afb4f7c93ae27d9fa.zip
[media] au0828: Refactoring for start_urb_transfer()
This issue was detected by using the Coccinelle software. 1. Let us return directly if a buffer allocation failed. 2. Delete the jump label "err" then. 3. Drop the explicit initialisation for the variable "ret" at the beginning. 4. Return zero as a constant at the end. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/usb/au0828/au0828-dvb.c')
-rw-r--r--drivers/media/usb/au0828/au0828-dvb.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/media/usb/au0828/au0828-dvb.c b/drivers/media/usb/au0828/au0828-dvb.c
index 94363a3ba400..0e174e860614 100644
--- a/drivers/media/usb/au0828/au0828-dvb.c
+++ b/drivers/media/usb/au0828/au0828-dvb.c
@@ -181,7 +181,7 @@ static int stop_urb_transfer(struct au0828_dev *dev)
static int start_urb_transfer(struct au0828_dev *dev)
{
struct urb *purb;
- int i, ret = -ENOMEM;
+ int i, ret;
dprintk(2, "%s()\n", __func__);
@@ -194,7 +194,7 @@ static int start_urb_transfer(struct au0828_dev *dev)
dev->urbs[i] = usb_alloc_urb(0, GFP_KERNEL);
if (!dev->urbs[i])
- goto err;
+ return -ENOMEM;
purb = dev->urbs[i];
@@ -207,9 +207,10 @@ static int start_urb_transfer(struct au0828_dev *dev)
if (!purb->transfer_buffer) {
usb_free_urb(purb);
dev->urbs[i] = NULL;
+ ret = -ENOMEM;
pr_err("%s: failed big buffer allocation, err = %d\n",
__func__, ret);
- goto err;
+ return ret;
}
purb->status = -EINPROGRESS;
@@ -235,10 +236,7 @@ static int start_urb_transfer(struct au0828_dev *dev)
}
dev->urb_streaming = true;
- ret = 0;
-
-err:
- return ret;
+ return 0;
}
static void au0828_start_transport(struct au0828_dev *dev)
OpenPOWER on IntegriCloud