diff options
author | Andy Walls <awalls@radix.net> | 2008-08-22 19:55:54 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-10-12 07:36:53 -0400 |
commit | 59ba2b002265f2e862aa7f0df3f13c09ea99c4da (patch) | |
tree | 308a5ed9334d267db054fd6675f61bbc6fce69bf /drivers/media | |
parent | a928880a5b65aa64bbbac880cdc65de85827ba20 (diff) |
V4L/DVB (8771): cx18: Remove redundant struct cx18_queue length member.
cx18: Remove redundant struct cx18_queue length member. It can be trivially
computed from queue->buffers * stream->buf_size, if ever really needed.
Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/cx18/cx18-driver.h | 1 | ||||
-rw-r--r-- | drivers/media/video/cx18/cx18-fileops.c | 2 | ||||
-rw-r--r-- | drivers/media/video/cx18/cx18-queue.c | 6 |
3 files changed, 1 insertions, 8 deletions
diff --git a/drivers/media/video/cx18/cx18-driver.h b/drivers/media/video/cx18/cx18-driver.h index db7483bea44a..28c490b1b64e 100644 --- a/drivers/media/video/cx18/cx18-driver.h +++ b/drivers/media/video/cx18/cx18-driver.h | |||
@@ -217,7 +217,6 @@ struct cx18_buffer { | |||
217 | struct cx18_queue { | 217 | struct cx18_queue { |
218 | struct list_head list; | 218 | struct list_head list; |
219 | u32 buffers; | 219 | u32 buffers; |
220 | u32 length; | ||
221 | u32 bytesused; | 220 | u32 bytesused; |
222 | }; | 221 | }; |
223 | 222 | ||
diff --git a/drivers/media/video/cx18/cx18-fileops.c b/drivers/media/video/cx18/cx18-fileops.c index 1e537fe04a23..2fdbfb994dd5 100644 --- a/drivers/media/video/cx18/cx18-fileops.c +++ b/drivers/media/video/cx18/cx18-fileops.c | |||
@@ -509,7 +509,7 @@ unsigned int cx18_v4l2_enc_poll(struct file *filp, poll_table *wait) | |||
509 | CX18_DEBUG_HI_FILE("Encoder poll\n"); | 509 | CX18_DEBUG_HI_FILE("Encoder poll\n"); |
510 | poll_wait(filp, &s->waitq, wait); | 510 | poll_wait(filp, &s->waitq, wait); |
511 | 511 | ||
512 | if (s->q_full.length || s->q_io.length) | 512 | if (s->q_full.buffers || s->q_io.buffers) |
513 | return POLLIN | POLLRDNORM; | 513 | return POLLIN | POLLRDNORM; |
514 | if (eof) | 514 | if (eof) |
515 | return POLLHUP; | 515 | return POLLHUP; |
diff --git a/drivers/media/video/cx18/cx18-queue.c b/drivers/media/video/cx18/cx18-queue.c index dbe792ac3001..4f3bd43ba802 100644 --- a/drivers/media/video/cx18/cx18-queue.c +++ b/drivers/media/video/cx18/cx18-queue.c | |||
@@ -38,7 +38,6 @@ void cx18_queue_init(struct cx18_queue *q) | |||
38 | { | 38 | { |
39 | INIT_LIST_HEAD(&q->list); | 39 | INIT_LIST_HEAD(&q->list); |
40 | q->buffers = 0; | 40 | q->buffers = 0; |
41 | q->length = 0; | ||
42 | q->bytesused = 0; | 41 | q->bytesused = 0; |
43 | } | 42 | } |
44 | 43 | ||
@@ -56,7 +55,6 @@ void cx18_enqueue(struct cx18_stream *s, struct cx18_buffer *buf, | |||
56 | spin_lock_irqsave(&s->qlock, flags); | 55 | spin_lock_irqsave(&s->qlock, flags); |
57 | list_add_tail(&buf->list, &q->list); | 56 | list_add_tail(&buf->list, &q->list); |
58 | q->buffers++; | 57 | q->buffers++; |
59 | q->length += s->buf_size; | ||
60 | q->bytesused += buf->bytesused - buf->readpos; | 58 | q->bytesused += buf->bytesused - buf->readpos; |
61 | spin_unlock_irqrestore(&s->qlock, flags); | 59 | spin_unlock_irqrestore(&s->qlock, flags); |
62 | } | 60 | } |
@@ -71,7 +69,6 @@ struct cx18_buffer *cx18_dequeue(struct cx18_stream *s, struct cx18_queue *q) | |||
71 | buf = list_entry(q->list.next, struct cx18_buffer, list); | 69 | buf = list_entry(q->list.next, struct cx18_buffer, list); |
72 | list_del_init(q->list.next); | 70 | list_del_init(q->list.next); |
73 | q->buffers--; | 71 | q->buffers--; |
74 | q->length -= s->buf_size; | ||
75 | q->bytesused -= buf->bytesused - buf->readpos; | 72 | q->bytesused -= buf->bytesused - buf->readpos; |
76 | } | 73 | } |
77 | spin_unlock_irqrestore(&s->qlock, flags); | 74 | spin_unlock_irqrestore(&s->qlock, flags); |
@@ -96,9 +93,7 @@ struct cx18_buffer *cx18_queue_get_buf_irq(struct cx18_stream *s, u32 id, | |||
96 | they are not moved to the full queue */ | 93 | they are not moved to the full queue */ |
97 | if (s->type != CX18_ENC_STREAM_TYPE_TS) { | 94 | if (s->type != CX18_ENC_STREAM_TYPE_TS) { |
98 | s->q_free.buffers--; | 95 | s->q_free.buffers--; |
99 | s->q_free.length -= s->buf_size; | ||
100 | s->q_full.buffers++; | 96 | s->q_full.buffers++; |
101 | s->q_full.length += s->buf_size; | ||
102 | s->q_full.bytesused += buf->bytesused; | 97 | s->q_full.bytesused += buf->bytesused; |
103 | list_move_tail(&buf->list, &s->q_full.list); | 98 | list_move_tail(&buf->list, &s->q_full.list); |
104 | } | 99 | } |
@@ -125,7 +120,6 @@ static void cx18_queue_flush(struct cx18_stream *s, struct cx18_queue *q) | |||
125 | list_move_tail(q->list.next, &s->q_free.list); | 120 | list_move_tail(q->list.next, &s->q_free.list); |
126 | buf->bytesused = buf->readpos = buf->b_flags = 0; | 121 | buf->bytesused = buf->readpos = buf->b_flags = 0; |
127 | s->q_free.buffers++; | 122 | s->q_free.buffers++; |
128 | s->q_free.length += s->buf_size; | ||
129 | } | 123 | } |
130 | cx18_queue_init(q); | 124 | cx18_queue_init(q); |
131 | spin_unlock_irqrestore(&s->qlock, flags); | 125 | spin_unlock_irqrestore(&s->qlock, flags); |