Commit 4df16f70 authored by Peter Senna Tschudin's avatar Peter Senna Tschudin Committed by Mauro Carvalho Chehab

[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: default avatarPeter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent 931387fa
...@@ -910,7 +910,6 @@ static int AllocateRingBuffers(struct pci_dev *pci_dev, ...@@ -910,7 +910,6 @@ static int AllocateRingBuffers(struct pci_dev *pci_dev,
{ {
dma_addr_t tmp; dma_addr_t tmp;
u32 i, j; u32 i, j;
int status = 0;
u32 SCListMemSize = pRingBuffer->NumBuffers u32 SCListMemSize = pRingBuffer->NumBuffers
* ((Buffer2Length != 0) ? (NUM_SCATTER_GATHER_ENTRIES * 2) : * ((Buffer2Length != 0) ? (NUM_SCATTER_GATHER_ENTRIES * 2) :
NUM_SCATTER_GATHER_ENTRIES) NUM_SCATTER_GATHER_ENTRIES)
...@@ -1010,14 +1009,12 @@ static int AllocateRingBuffers(struct pci_dev *pci_dev, ...@@ -1010,14 +1009,12 @@ static int AllocateRingBuffers(struct pci_dev *pci_dev,
} }
return status; return 0;
} }
static int FillTSIdleBuffer(struct SRingBufferDescriptor *pIdleBuffer, static int FillTSIdleBuffer(struct SRingBufferDescriptor *pIdleBuffer,
struct SRingBufferDescriptor *pRingBuffer) struct SRingBufferDescriptor *pRingBuffer)
{ {
int status = 0;
/* Copy pointer to scatter gather list in TSRingbuffer /* Copy pointer to scatter gather list in TSRingbuffer
structure for buffer 2 structure for buffer 2
Load number of buffer Load number of buffer
...@@ -1038,7 +1035,7 @@ static int FillTSIdleBuffer(struct SRingBufferDescriptor *pIdleBuffer, ...@@ -1038,7 +1035,7 @@ static int FillTSIdleBuffer(struct SRingBufferDescriptor *pIdleBuffer,
pIdleBuffer->Head->ngeneBuffer.Number_of_entries_1; pIdleBuffer->Head->ngeneBuffer.Number_of_entries_1;
Cur = Cur->Next; Cur = Cur->Next;
} }
return status; return 0;
} }
static u32 RingBufferSizes[MAX_STREAM] = { static u32 RingBufferSizes[MAX_STREAM] = {
......
...@@ -208,7 +208,7 @@ static inline void get_next_buf(struct cx231xx_dmaqueue *dma_q, ...@@ -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) static inline int cx231xx_isoc_copy(struct cx231xx *dev, struct urb *urb)
{ {
struct cx231xx_dmaqueue *dma_q = urb->context; struct cx231xx_dmaqueue *dma_q = urb->context;
int i, rc = 1; int i;
unsigned char *p_buffer; unsigned char *p_buffer;
u32 bytes_parsed = 0, buffer_size = 0; u32 bytes_parsed = 0, buffer_size = 0;
u8 sav_eav = 0; u8 sav_eav = 0;
...@@ -299,13 +299,12 @@ static inline int cx231xx_isoc_copy(struct cx231xx *dev, struct urb *urb) ...@@ -299,13 +299,12 @@ static inline int cx231xx_isoc_copy(struct cx231xx *dev, struct urb *urb)
bytes_parsed = 0; bytes_parsed = 0;
} }
return rc; return 1;
} }
static inline int cx231xx_bulk_copy(struct cx231xx *dev, struct urb *urb) static inline int cx231xx_bulk_copy(struct cx231xx *dev, struct urb *urb)
{ {
struct cx231xx_dmaqueue *dma_q = urb->context; struct cx231xx_dmaqueue *dma_q = urb->context;
int rc = 1;
unsigned char *p_buffer; unsigned char *p_buffer;
u32 bytes_parsed = 0, buffer_size = 0; u32 bytes_parsed = 0, buffer_size = 0;
u8 sav_eav = 0; u8 sav_eav = 0;
...@@ -379,7 +378,7 @@ static inline int cx231xx_bulk_copy(struct cx231xx *dev, struct urb *urb) ...@@ -379,7 +378,7 @@ static inline int cx231xx_bulk_copy(struct cx231xx *dev, struct urb *urb)
bytes_parsed = 0; 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 ...@@ -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) static int cx231xx_v4l2_open(struct file *filp)
{ {
int errCode = 0, radio = 0; int radio = 0;
struct video_device *vdev = video_devdata(filp); struct video_device *vdev = video_devdata(filp);
struct cx231xx *dev = video_drvdata(filp); struct cx231xx *dev = video_drvdata(filp);
struct cx231xx_fh *fh; struct cx231xx_fh *fh;
...@@ -1718,7 +1717,7 @@ static int cx231xx_v4l2_open(struct file *filp) ...@@ -1718,7 +1717,7 @@ static int cx231xx_v4l2_open(struct file *filp)
mutex_unlock(&dev->lock); mutex_unlock(&dev->lock);
v4l2_fh_add(&fh->fh); v4l2_fh_add(&fh->fh);
return errCode; return 0;
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment