summaryrefslogtreecommitdiff
path: root/linux/drivers/media
diff options
context:
space:
mode:
authorAndy Walls <awalls@radix.net>2008-08-22 19:55:54 -0400
committerAndy Walls <awalls@radix.net>2008-08-22 19:55:54 -0400
commitdbcd49d6f8956af76b5e13e4967054f3983732f2 (patch)
treed466897576b2d0ce842358d443e9f3b255a1ec4f /linux/drivers/media
parent9a231bd1781ccb810b1c75634b3138d229b3193d (diff)
downloadmediapointer-dvb-s2-dbcd49d6f8956af76b5e13e4967054f3983732f2.tar.gz
mediapointer-dvb-s2-dbcd49d6f8956af76b5e13e4967054f3983732f2.tar.bz2
cx18: Remove redundant struct cx18_queue length member.
From: Andy Walls <awalls@radix.net> cx18: Remove redundant struct cx18_queue length member. It can be trivially computed from queue->buffers * stream->buf_size, if ever really needed. Priority: normal Signed-off-by: Andy Walls <awalls@radix.net>
Diffstat (limited to 'linux/drivers/media')
-rw-r--r--linux/drivers/media/video/cx18/cx18-driver.h1
-rw-r--r--linux/drivers/media/video/cx18/cx18-fileops.c2
-rw-r--r--linux/drivers/media/video/cx18/cx18-queue.c6
3 files changed, 1 insertions, 8 deletions
diff --git a/linux/drivers/media/video/cx18/cx18-driver.h b/linux/drivers/media/video/cx18/cx18-driver.h
index db7483bea..28c490b1b 100644
--- a/linux/drivers/media/video/cx18/cx18-driver.h
+++ b/linux/drivers/media/video/cx18/cx18-driver.h
@@ -217,7 +217,6 @@ struct cx18_buffer {
struct cx18_queue {
struct list_head list;
u32 buffers;
- u32 length;
u32 bytesused;
};
diff --git a/linux/drivers/media/video/cx18/cx18-fileops.c b/linux/drivers/media/video/cx18/cx18-fileops.c
index 12f9de74d..7296e9100 100644
--- a/linux/drivers/media/video/cx18/cx18-fileops.c
+++ b/linux/drivers/media/video/cx18/cx18-fileops.c
@@ -544,7 +544,7 @@ unsigned int cx18_v4l2_enc_poll(struct file *filp, poll_table *wait)
CX18_DEBUG_HI_FILE("Encoder poll\n");
poll_wait(filp, &s->waitq, wait);
- if (s->q_full.length || s->q_io.length)
+ if (s->q_full.buffers || s->q_io.buffers)
return POLLIN | POLLRDNORM;
if (eof)
return POLLHUP;
diff --git a/linux/drivers/media/video/cx18/cx18-queue.c b/linux/drivers/media/video/cx18/cx18-queue.c
index 031558bfa..902fbd118 100644
--- a/linux/drivers/media/video/cx18/cx18-queue.c
+++ b/linux/drivers/media/video/cx18/cx18-queue.c
@@ -38,7 +38,6 @@ void cx18_queue_init(struct cx18_queue *q)
{
INIT_LIST_HEAD(&q->list);
q->buffers = 0;
- q->length = 0;
q->bytesused = 0;
}
@@ -56,7 +55,6 @@ void cx18_enqueue(struct cx18_stream *s, struct cx18_buffer *buf,
spin_lock_irqsave(&s->qlock, flags);
list_add_tail(&buf->list, &q->list);
q->buffers++;
- q->length += s->buf_size;
q->bytesused += buf->bytesused - buf->readpos;
spin_unlock_irqrestore(&s->qlock, flags);
}
@@ -71,7 +69,6 @@ struct cx18_buffer *cx18_dequeue(struct cx18_stream *s, struct cx18_queue *q)
buf = list_entry(q->list.next, struct cx18_buffer, list);
list_del_init(q->list.next);
q->buffers--;
- q->length -= s->buf_size;
q->bytesused -= buf->bytesused - buf->readpos;
}
spin_unlock_irqrestore(&s->qlock, flags);
@@ -96,9 +93,7 @@ struct cx18_buffer *cx18_queue_get_buf_irq(struct cx18_stream *s, u32 id,
they are not moved to the full queue */
if (s->type != CX18_ENC_STREAM_TYPE_TS) {
s->q_free.buffers--;
- s->q_free.length -= s->buf_size;
s->q_full.buffers++;
- s->q_full.length += s->buf_size;
s->q_full.bytesused += buf->bytesused;
list_move_tail(&buf->list, &s->q_full.list);
}
@@ -125,7 +120,6 @@ static void cx18_queue_flush(struct cx18_stream *s, struct cx18_queue *q)
list_move_tail(q->list.next, &s->q_free.list);
buf->bytesused = buf->readpos = buf->b_flags = 0;
s->q_free.buffers++;
- s->q_free.length += s->buf_size;
}
cx18_queue_init(q);
spin_unlock_irqrestore(&s->qlock, flags);