aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Senna Tschudin <peter.senna@gmail.com>2014-05-31 12:30:52 -0400
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-07-04 14:35:27 -0400
commit4df16f702c38221f611006bda45377278b2ec325 (patch)
tree26212f5531c376d62a353658976e3e71cc67a9e6
parent931387fa941ec0da2f4a6999bec69bc608af311e (diff)
[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>
-rw-r--r--drivers/media/pci/ngene/ngene-core.c7
-rw-r--r--drivers/media/usb/cx231xx/cx231xx-video.c11
2 files changed, 7 insertions, 11 deletions
diff --git a/drivers/media/pci/ngene/ngene-core.c b/drivers/media/pci/ngene/ngene-core.c
index 970e83308525..826228c3800e 100644
--- a/drivers/media/pci/ngene/ngene-core.c
+++ b/drivers/media/pci/ngene/ngene-core.c
@@ -910,7 +910,6 @@ static int AllocateRingBuffers(struct pci_dev *pci_dev,
910{ 910{
911 dma_addr_t tmp; 911 dma_addr_t tmp;
912 u32 i, j; 912 u32 i, j;
913 int status = 0;
914 u32 SCListMemSize = pRingBuffer->NumBuffers 913 u32 SCListMemSize = pRingBuffer->NumBuffers
915 * ((Buffer2Length != 0) ? (NUM_SCATTER_GATHER_ENTRIES * 2) : 914 * ((Buffer2Length != 0) ? (NUM_SCATTER_GATHER_ENTRIES * 2) :
916 NUM_SCATTER_GATHER_ENTRIES) 915 NUM_SCATTER_GATHER_ENTRIES)
@@ -1010,14 +1009,12 @@ static int AllocateRingBuffers(struct pci_dev *pci_dev,
1010 1009
1011 } 1010 }
1012 1011
1013 return status; 1012 return 0;
1014} 1013}
1015 1014
1016static int FillTSIdleBuffer(struct SRingBufferDescriptor *pIdleBuffer, 1015static int FillTSIdleBuffer(struct SRingBufferDescriptor *pIdleBuffer,
1017 struct SRingBufferDescriptor *pRingBuffer) 1016 struct SRingBufferDescriptor *pRingBuffer)
1018{ 1017{
1019 int status = 0;
1020
1021 /* Copy pointer to scatter gather list in TSRingbuffer 1018 /* Copy pointer to scatter gather list in TSRingbuffer
1022 structure for buffer 2 1019 structure for buffer 2
1023 Load number of buffer 1020 Load number of buffer
@@ -1038,7 +1035,7 @@ static int FillTSIdleBuffer(struct SRingBufferDescriptor *pIdleBuffer,
1038 pIdleBuffer->Head->ngeneBuffer.Number_of_entries_1; 1035 pIdleBuffer->Head->ngeneBuffer.Number_of_entries_1;
1039 Cur = Cur->Next; 1036 Cur = Cur->Next;
1040 } 1037 }
1041 return status; 1038 return 0;
1042} 1039}
1043 1040
1044static u32 RingBufferSizes[MAX_STREAM] = { 1041static u32 RingBufferSizes[MAX_STREAM] = {
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,
208static inline int cx231xx_isoc_copy(struct cx231xx *dev, struct urb *urb) 208static inline int cx231xx_isoc_copy(struct cx231xx *dev, struct urb *urb)
209{ 209{
210 struct cx231xx_dmaqueue *dma_q = urb->context; 210 struct cx231xx_dmaqueue *dma_q = urb->context;
211 int i, rc = 1; 211 int i;
212 unsigned char *p_buffer; 212 unsigned char *p_buffer;
213 u32 bytes_parsed = 0, buffer_size = 0; 213 u32 bytes_parsed = 0, buffer_size = 0;
214 u8 sav_eav = 0; 214 u8 sav_eav = 0;
@@ -299,13 +299,12 @@ static inline int cx231xx_isoc_copy(struct cx231xx *dev, struct urb *urb)
299 bytes_parsed = 0; 299 bytes_parsed = 0;
300 300
301 } 301 }
302 return rc; 302 return 1;
303} 303}
304 304
305static inline int cx231xx_bulk_copy(struct cx231xx *dev, struct urb *urb) 305static inline int cx231xx_bulk_copy(struct cx231xx *dev, struct urb *urb)
306{ 306{
307 struct cx231xx_dmaqueue *dma_q = urb->context; 307 struct cx231xx_dmaqueue *dma_q = urb->context;
308 int rc = 1;
309 unsigned char *p_buffer; 308 unsigned char *p_buffer;
310 u32 bytes_parsed = 0, buffer_size = 0; 309 u32 bytes_parsed = 0, buffer_size = 0;
311 u8 sav_eav = 0; 310 u8 sav_eav = 0;
@@ -379,7 +378,7 @@ static inline int cx231xx_bulk_copy(struct cx231xx *dev, struct urb *urb)
379 bytes_parsed = 0; 378 bytes_parsed = 0;
380 379
381 } 380 }
382 return rc; 381 return 1;
383} 382}
384 383
385 384
@@ -1620,7 +1619,7 @@ static int radio_s_tuner(struct file *file, void *priv, const struct v4l2_tuner
1620 */ 1619 */
1621static int cx231xx_v4l2_open(struct file *filp) 1620static int cx231xx_v4l2_open(struct file *filp)
1622{ 1621{
1623 int errCode = 0, radio = 0; 1622 int radio = 0;
1624 struct video_device *vdev = video_devdata(filp); 1623 struct video_device *vdev = video_devdata(filp);
1625 struct cx231xx *dev = video_drvdata(filp); 1624 struct cx231xx *dev = video_drvdata(filp);
1626 struct cx231xx_fh *fh; 1625 struct cx231xx_fh *fh;
@@ -1718,7 +1717,7 @@ static int cx231xx_v4l2_open(struct file *filp)
1718 mutex_unlock(&dev->lock); 1717 mutex_unlock(&dev->lock);
1719 v4l2_fh_add(&fh->fh); 1718 v4l2_fh_add(&fh->fh);
1720 1719
1721 return errCode; 1720 return 0;
1722} 1721}
1723 1722
1724/* 1723/*