[media] v4l2: use list_move_tail instead of list_del/list_add_tail
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Mon, 8 Oct 2012 11:34:09 +0000 (08:34 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Thu, 25 Oct 2012 18:14:28 +0000 (16:14 -0200)
Using list_move_tail() instead of list_del() + list_add_tail().
dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/platform/fsl-viu.c

index 31ac4dc692475a5b5f1339941617569fd936f43e..a8ddb0cacab82cc7d81e5c3f17b6d4d5f29d9a2a 100644 (file)
@@ -352,8 +352,7 @@ static int restart_video_queue(struct viu_dmaqueue *vidq)
                        return 0;
                buf = list_entry(vidq->queued.next, struct viu_buf, vb.queue);
                if (prev == NULL) {
-                       list_del(&buf->vb.queue);
-                       list_add_tail(&buf->vb.queue, &vidq->active);
+                       list_move_tail(&buf->vb.queue, &vidq->active);
 
                        dprintk(1, "Restarting video dma\n");
                        viu_stop_dma(vidq->dev);
@@ -367,8 +366,7 @@ static int restart_video_queue(struct viu_dmaqueue *vidq)
                } else if (prev->vb.width  == buf->vb.width  &&
                           prev->vb.height == buf->vb.height &&
                           prev->fmt       == buf->fmt) {
-                       list_del(&buf->vb.queue);
-                       list_add_tail(&buf->vb.queue, &vidq->active);
+                       list_move_tail(&buf->vb.queue, &vidq->active);
                        buf->vb.state = VIDEOBUF_ACTIVE;
                        dprintk(2, "[%p/%d] restart_queue - move to active\n",
                                buf, buf->vb.i);