diff options
author | Peter Senna Tschudin <peter.senna@gmail.com> | 2014-05-31 13:30:52 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-07-04 15:35:27 -0300 |
commit | 4df16f702c38221f611006bda45377278b2ec325 (patch) | |
tree | 26212f5531c376d62a353658976e3e71cc67a9e6 /drivers/media/usb | |
parent | 931387fa941ec0da2f4a6999bec69bc608af311e (diff) | |
download | blackbird-op-linux-4df16f702c38221f611006bda45377278b2ec325.tar.gz blackbird-op-linux-4df16f702c38221f611006bda45377278b2ec325.zip |
[media] drivers/media: Remove useless return variables
This patch remove variables that are initialized with a constant,
are never updated, and are only used as parameter of return.
Return the constant instead of using a variable.
Verified by compilation only.
The coccinelle script that find and fixes this issue is:
// <smpl>
@@
type T;
constant C;
identifier ret;
@@
- T ret = C;
... when != ret
when strict
return
- ret
+ C
;
// </smpl>
Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/usb')
-rw-r--r-- | drivers/media/usb/cx231xx/cx231xx-video.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/media/usb/cx231xx/cx231xx-video.c b/drivers/media/usb/cx231xx/cx231xx-video.c index 1f8751379e24..cba7fea3c6cd 100644 --- a/drivers/media/usb/cx231xx/cx231xx-video.c +++ b/drivers/media/usb/cx231xx/cx231xx-video.c @@ -208,7 +208,7 @@ static inline void get_next_buf(struct cx231xx_dmaqueue *dma_q, static inline int cx231xx_isoc_copy(struct cx231xx *dev, struct urb *urb) { struct cx231xx_dmaqueue *dma_q = urb->context; - int i, rc = 1; + int i; unsigned char *p_buffer; u32 bytes_parsed = 0, buffer_size = 0; u8 sav_eav = 0; @@ -299,13 +299,12 @@ static inline int cx231xx_isoc_copy(struct cx231xx *dev, struct urb *urb) bytes_parsed = 0; } - return rc; + return 1; } static inline int cx231xx_bulk_copy(struct cx231xx *dev, struct urb *urb) { struct cx231xx_dmaqueue *dma_q = urb->context; - int rc = 1; unsigned char *p_buffer; u32 bytes_parsed = 0, buffer_size = 0; u8 sav_eav = 0; @@ -379,7 +378,7 @@ static inline int cx231xx_bulk_copy(struct cx231xx *dev, struct urb *urb) bytes_parsed = 0; } - return rc; + return 1; } @@ -1620,7 +1619,7 @@ static int radio_s_tuner(struct file *file, void *priv, const struct v4l2_tuner */ static int cx231xx_v4l2_open(struct file *filp) { - int errCode = 0, radio = 0; + int radio = 0; struct video_device *vdev = video_devdata(filp); struct cx231xx *dev = video_drvdata(filp); struct cx231xx_fh *fh; @@ -1718,7 +1717,7 @@ static int cx231xx_v4l2_open(struct file *filp) mutex_unlock(&dev->lock); v4l2_fh_add(&fh->fh); - return errCode; + return 0; } /* |