Skip to content

Commit

Permalink
[media] ddbridge: fix compiler warnings
Browse files Browse the repository at this point in the history
'off' was unused and 'ret' really had to be used to return -EFAULT.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Sep 6, 2011
1 parent 7b4668e commit 2122eaf
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions drivers/media/dvb/ddbridge/ddbridge-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -507,15 +507,14 @@ static u32 ddb_input_avail(struct ddb_input *input)
return 0;
}

static size_t ddb_input_read(struct ddb_input *input, u8 *buf, size_t count)
static ssize_t ddb_input_read(struct ddb_input *input, u8 *buf, size_t count)
{
struct ddb *dev = input->port->dev;
u32 left = count;
u32 idx, off, free, stat = input->stat;
u32 idx, free, stat = input->stat;
int ret;

idx = (stat >> 11) & 0x1f;
off = (stat & 0x7ff) << 7;

while (left) {
if (input->cbuf == idx)
Expand All @@ -525,6 +524,8 @@ static size_t ddb_input_read(struct ddb_input *input, u8 *buf, size_t count)
free = left;
ret = copy_to_user(buf, input->vbuf[input->cbuf] +
input->coff, free);
if (ret)
return -EFAULT;
input->coff += free;
if (input->coff == input->dma_buf_size) {
input->coff = 0;
Expand Down Expand Up @@ -939,6 +940,8 @@ static ssize_t ts_read(struct file *file, char *buf,
break;
}
read = ddb_input_read(input, buf, left);
if (read < 0)
return read;
left -= read;
buf += read;
}
Expand Down

0 comments on commit 2122eaf

Please sign in to comment.