From patchwork Mon Dec 16 10:53:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sascha Hauer X-Patchwork-Id: 11293769 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3774B1593 for ; Mon, 16 Dec 2019 10:53:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1254420725 for ; Mon, 16 Dec 2019 10:53:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727229AbfLPKxf (ORCPT ); Mon, 16 Dec 2019 05:53:35 -0500 Received: from metis.ext.pengutronix.de ([85.220.165.71]:60969 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727099AbfLPKxf (ORCPT ); Mon, 16 Dec 2019 05:53:35 -0500 Received: from dude.hi.pengutronix.de ([2001:67c:670:100:1d::7]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1igo0L-0001dc-9O; Mon, 16 Dec 2019 11:53:33 +0100 Received: from sha by dude.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1igo0I-0005tJ-EH; Mon, 16 Dec 2019 11:53:30 +0100 From: Sascha Hauer To: dmaengine@vger.kernel.org Cc: Vinod Koul , Peter Ujfalusi , Florian Fainelli , Maxime Ripard , Green Wan , Kukjin Kim , Krzysztof Kozlowski , =?utf-8?q?Andreas_F=C3=A4rber?= , Sean Wang , Eugeniy Paltsev , Pengutronix Kernel Team , NXP Linux Team , Robert Jarzmik , Sascha Hauer Subject: [PATCH 6/9] dmaengine: virt-dma: use vchan_vdesc_fini() to free descriptors Date: Mon, 16 Dec 2019 11:53:25 +0100 Message-Id: <20191216105328.15198-7-s.hauer@pengutronix.de> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191216105328.15198-1-s.hauer@pengutronix.de> References: <20191216105328.15198-1-s.hauer@pengutronix.de> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::7 X-SA-Exim-Mail-From: sha@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dmaengine@vger.kernel.org Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org vchan_dma_desc_free_list() basically open codes vchan_vdesc_fini() in its loop body. Call it directly rather than duplicating the code. Signed-off-by: Sascha Hauer --- drivers/dma/virt-dma.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/dma/virt-dma.c b/drivers/dma/virt-dma.c index 26e08c7a7465..95dfe431777e 100644 --- a/drivers/dma/virt-dma.c +++ b/drivers/dma/virt-dma.c @@ -115,16 +115,8 @@ void vchan_dma_desc_free_list(struct virt_dma_chan *vc, struct list_head *head) struct virt_dma_desc *vd, *_vd; list_for_each_entry_safe(vd, _vd, head, node) { - if (dmaengine_desc_test_reuse(&vd->tx)) { - unsigned long flags; - - spin_lock_irqsave(&vc->lock, flags); - list_move_tail(&vd->node, &vc->desc_allocated); - spin_unlock_irqrestore(&vc->lock, flags); - } else { - list_del(&vd->node); - vc->desc_free(vd); - } + list_del(&vd->node); + vchan_vdesc_fini(vd); } } EXPORT_SYMBOL_GPL(vchan_dma_desc_free_list);