diff options
author | Guennadi Liakhovetski <g.liakhovetski@pengutronix.de> | 2008-04-22 13:46:03 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-04-24 13:07:51 -0400 |
commit | 7daa4a8897e79911f524ddac065adea05c7e9b16 (patch) | |
tree | b98c96df4282870130fcc712dd3832871fb90dc1 /drivers | |
parent | b2cb200f0d0d5e801b47635554519f6e1b64e847 (diff) |
V4L/DVB (7378): cleanup variable initialization
flags used for spinlocks don't need to be initialized, except where the
compiler has no way to see, that the spin_unlock_irqrestore is only called
if the spin_lock_irqsave has been called before. Local variable
initialization doesn't have to be protected.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@pengutronix.de>
Reviewed-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/video/ivtv/ivtv-queue.c | 4 | ||||
-rw-r--r-- | drivers/media/video/videobuf-core.c | 3 |
2 files changed, 3 insertions, 4 deletions
diff --git a/drivers/media/video/ivtv/ivtv-queue.c b/drivers/media/video/ivtv/ivtv-queue.c index 39a216713244..3e1deec67a5e 100644 --- a/drivers/media/video/ivtv/ivtv-queue.c +++ b/drivers/media/video/ivtv/ivtv-queue.c | |||
@@ -51,7 +51,7 @@ void ivtv_queue_init(struct ivtv_queue *q) | |||
51 | 51 | ||
52 | void ivtv_enqueue(struct ivtv_stream *s, struct ivtv_buffer *buf, struct ivtv_queue *q) | 52 | void ivtv_enqueue(struct ivtv_stream *s, struct ivtv_buffer *buf, struct ivtv_queue *q) |
53 | { | 53 | { |
54 | unsigned long flags = 0; | 54 | unsigned long flags; |
55 | 55 | ||
56 | /* clear the buffer if it is going to be enqueued to the free queue */ | 56 | /* clear the buffer if it is going to be enqueued to the free queue */ |
57 | if (q == &s->q_free) { | 57 | if (q == &s->q_free) { |
@@ -71,7 +71,7 @@ void ivtv_enqueue(struct ivtv_stream *s, struct ivtv_buffer *buf, struct ivtv_qu | |||
71 | struct ivtv_buffer *ivtv_dequeue(struct ivtv_stream *s, struct ivtv_queue *q) | 71 | struct ivtv_buffer *ivtv_dequeue(struct ivtv_stream *s, struct ivtv_queue *q) |
72 | { | 72 | { |
73 | struct ivtv_buffer *buf = NULL; | 73 | struct ivtv_buffer *buf = NULL; |
74 | unsigned long flags = 0; | 74 | unsigned long flags; |
75 | 75 | ||
76 | spin_lock_irqsave(&s->qlock, flags); | 76 | spin_lock_irqsave(&s->qlock, flags); |
77 | if (!list_empty(&q->list)) { | 77 | if (!list_empty(&q->list)) { |
diff --git a/drivers/media/video/videobuf-core.c b/drivers/media/video/videobuf-core.c index 137a1ff4a149..fe742fdfae07 100644 --- a/drivers/media/video/videobuf-core.c +++ b/drivers/media/video/videobuf-core.c | |||
@@ -742,14 +742,13 @@ ssize_t videobuf_read_one(struct videobuf_queue *q, | |||
742 | { | 742 | { |
743 | enum v4l2_field field; | 743 | enum v4l2_field field; |
744 | unsigned long flags = 0; | 744 | unsigned long flags = 0; |
745 | unsigned size, nbufs; | 745 | unsigned size = 0, nbufs = 1; |
746 | int retval; | 746 | int retval; |
747 | 747 | ||
748 | MAGIC_CHECK(q->int_ops->magic, MAGIC_QTYPE_OPS); | 748 | MAGIC_CHECK(q->int_ops->magic, MAGIC_QTYPE_OPS); |
749 | 749 | ||
750 | mutex_lock(&q->vb_lock); | 750 | mutex_lock(&q->vb_lock); |
751 | 751 | ||
752 | nbufs = 1; size = 0; | ||
753 | q->ops->buf_setup(q, &nbufs, &size); | 752 | q->ops->buf_setup(q, &nbufs, &size); |
754 | 753 | ||
755 | if (NULL == q->read_buf && | 754 | if (NULL == q->read_buf && |