From patchwork Mon Oct 8 12:33:49 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 14951 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1TLCWu-0003Qz-9e for patchwork@linuxtv.org; Mon, 08 Oct 2012 14:33:52 +0200 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.75/mailfrontend-3) with esmtp for id 1TLCWt-0004nh-Dg; Mon, 08 Oct 2012 14:33:52 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752093Ab2JHMdt (ORCPT ); Mon, 8 Oct 2012 08:33:49 -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 S1751845Ab2JHMdt (ORCPT ); Mon, 8 Oct 2012 08:33:49 -0400 Received: by mail-qc0-f174.google.com with SMTP id d3so2796440qch.19 for ; Mon, 08 Oct 2012 05:33:49 -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=GhhPNfT5ETcnWesRV1nYfFGXKmA0zW89nprzAVV2LhM=; b=VpPImlFaueaovAjfyfMrx1CaMw3bLbPcjNNlOBGloP6PjYM1ThVUawglyf8ME2q0zK B36HSBKms4A57XtTiJSg8z/rWnZhN886n/X+EVt07D5IK3Z2dcyD8PDVqfvY8kU21Ka1 0s5w+D+kYiOg/ghBszGWnmRKqLmCeo+QmmakIepqlmefpKjomZlyEs/VaBz9su1Ixc+j UH0Y+qP0YA6Opyj7UVrYuP8tWebWH2HCJBDzGG5gwnPmH2iJ5pOyu0KaVO+SFKtWSRMK Nkv6kVpuwTu76zOSHBXskx9RLLd0XAS0Q+PQzSkYWmBK3e7eqUvPq6THE6iSL23uLmub mOuA== MIME-Version: 1.0 Received: by 10.49.14.228 with SMTP id s4mr42022782qec.4.1349699629062; Mon, 08 Oct 2012 05:33:49 -0700 (PDT) Received: by 10.229.146.194 with HTTP; Mon, 8 Oct 2012 05:33:49 -0700 (PDT) Date: Mon, 8 Oct 2012 20:33:49 +0800 Message-ID: Subject: [PATCH] cx88: use list_move_tail instead of list_del/list_add_tail From: Wei Yongjun To: mchehab@infradead.org Cc: yongjun_wei@trendmicro.com.cn, linux-media@vger.kernel.org Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.10.8.122118 X-PMX-Spam: Gauge=IIIIIIIII, Probability=9%, Report=' CN_TLD 0.1, FORGED_FROM_GMAIL 0.1, MULTIPLE_RCPTS 0.1, HTML_00_01 0.05, HTML_00_10 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1600_1699 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, DKIM_SIGNATURE 0, URI_ENDS_IN_HTML 0, WEBMAIL_SOURCE 0, __ANY_URI 0, __CP_URI_IN_BODY 0, __CT 0, __CT_TEXT_PLAIN 0, __DATE_TZ_HK 0, __FRAUD_WEBMAIL 0, __FRAUD_WEBMAIL_FROM 0, __FROM_GMAIL 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_X_MAILING_LIST 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __MULTIPLE_RCPTS_CC_X2 0, __PHISH_SPEAR_HTTP_RECEIVED 0, __PHISH_SPEAR_STRUCTURE_1 0, __PHISH_SPEAR_STRUCTURE_2 0, __SANE_MSGID 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_WWW 0, __URI_NS ' 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/pci/cx88/cx88-mpeg.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/pci/cx88/cx88-mpeg.c b/drivers/media/pci/cx88/cx88-mpeg.c index c04fb61..33f6f87 100644 --- a/drivers/media/pci/cx88/cx88-mpeg.c +++ b/drivers/media/pci/cx88/cx88-mpeg.c @@ -217,8 +217,7 @@ static int cx8802_restart_queue(struct cx8802_dev *dev, return 0; buf = list_entry(q->queued.next, struct cx88_buffer, vb.queue); if (NULL == prev) { - list_del(&buf->vb.queue); - list_add_tail(&buf->vb.queue,&q->active); + list_move_tail(&buf->vb.queue, &q->active); cx8802_start_dma(dev, q, buf); buf->vb.state = VIDEOBUF_ACTIVE; buf->count = q->count++; @@ -229,8 +228,7 @@ static int cx8802_restart_queue(struct cx8802_dev *dev, } 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,&q->active); + list_move_tail(&buf->vb.queue, &q->active); buf->vb.state = VIDEOBUF_ACTIVE; buf->count = q->count++; prev->risc.jmp[1] = cpu_to_le32(buf->risc.dma);