V4L/DVB (7378): cleanup variable initialization
authorGuennadi Liakhovetski <g.liakhovetski@pengutronix.de>
Tue, 22 Apr 2008 17:46:03 +0000 (14:46 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Thu, 24 Apr 2008 17:07:51 +0000 (14:07 -0300)
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>
drivers/media/video/ivtv/ivtv-queue.c
drivers/media/video/videobuf-core.c

index 39a2167..3e1deec 100644 (file)
@@ -51,7 +51,7 @@ void ivtv_queue_init(struct ivtv_queue *q)
 
 void ivtv_enqueue(struct ivtv_stream *s, struct ivtv_buffer *buf, struct ivtv_queue *q)
 {
-       unsigned long flags = 0;
+       unsigned long flags;
 
        /* clear the buffer if it is going to be enqueued to the free queue */
        if (q == &s->q_free) {
@@ -71,7 +71,7 @@ void ivtv_enqueue(struct ivtv_stream *s, struct ivtv_buffer *buf, struct ivtv_qu
 struct ivtv_buffer *ivtv_dequeue(struct ivtv_stream *s, struct ivtv_queue *q)
 {
        struct ivtv_buffer *buf = NULL;
-       unsigned long flags = 0;
+       unsigned long flags;
 
        spin_lock_irqsave(&s->qlock, flags);
        if (!list_empty(&q->list)) {
index 137a1ff..fe742fd 100644 (file)
@@ -742,14 +742,13 @@ ssize_t videobuf_read_one(struct videobuf_queue *q,
 {
        enum v4l2_field field;
        unsigned long flags = 0;
-       unsigned size, nbufs;
+       unsigned size = 0, nbufs = 1;
        int retval;
 
        MAGIC_CHECK(q->int_ops->magic, MAGIC_QTYPE_OPS);
 
        mutex_lock(&q->vb_lock);
 
-       nbufs = 1; size = 0;
        q->ops->buf_setup(q, &nbufs, &size);
 
        if (NULL == q->read_buf  &&