From patchwork Mon Oct 8 12:34:09 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 1565321 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id AAA5040135 for ; Mon, 8 Oct 2012 12:34:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752079Ab2JHMeL (ORCPT ); Mon, 8 Oct 2012 08:34:11 -0400 Received: from mail-qc0-f174.google.com ([209.85.216.174]:54249 "EHLO mail-qc0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751845Ab2JHMeJ (ORCPT ); Mon, 8 Oct 2012 08:34:09 -0400 Received: by mail-qc0-f174.google.com with SMTP id d3so2796440qch.19 for ; Mon, 08 Oct 2012 05:34:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type; bh=JXXwM3+v50hek4Q4y8E6dbMezTEjIJtPVDzQdS9bkpU=; b=dsEwBm5Yq4p2n82U5yTriyXou8dU/vrQ0qbAl/a6H/yzGNrBAl2X1RfmzHYkSRmPXN bKsNkX5w/C50Ao7o/bFPKzeD43VN4G6bMWtE9no/C4wh3a2e/gQEbtrGwIXfpWoTg7WM UzyaEog48In7gLIUHcWo7eLnI0LTkYyZzRL7UY79VJw7RkcPa+G5WBc+kJAoM1cdgRdS 8dzw/ZVWIZ2YZeBRpEPslQdRbQyHPW7Qe6zyB7w91Ghpj8Pcn5dOZDMHs7rW4/cVC32+ YzS/frav6jaQinrXR0LAspA5y07RQtK09isUo3CLs9MenDc69FUcw9LkGPalH+15bsRR A4aw== MIME-Version: 1.0 Received: by 10.229.209.220 with SMTP id gh28mr6972785qcb.19.1349699649499; Mon, 08 Oct 2012 05:34:09 -0700 (PDT) Received: by 10.229.146.194 with HTTP; Mon, 8 Oct 2012 05:34:09 -0700 (PDT) Date: Mon, 8 Oct 2012 20:34:09 +0800 Message-ID: Subject: [PATCH] [media] v4l2: use list_move_tail instead of list_del/list_add_tail From: Wei Yongjun To: mchehab@infradead.org, grant.likely@secretlab.ca, rob.herring@calxeda.com Cc: yongjun_wei@trendmicro.com.cn, linux-media@vger.kernel.org, devicetree-discuss@lists.ozlabs.org Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Wei Yongjun 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 --- drivers/media/platform/fsl-viu.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/media/platform/fsl-viu.c b/drivers/media/platform/fsl-viu.c index 897250b..c5091fe 100644 --- a/drivers/media/platform/fsl-viu.c +++ b/drivers/media/platform/fsl-viu.c @@ -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);