Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp691719imm; Wed, 25 Jul 2018 04:39:59 -0700 (PDT) X-Google-Smtp-Source: AAOMgpflj/t7SdnVdH/AjidptUqKNT163bmjA/sB/UODJbspaBDny7trLpFjf1WY3zBlmWTsqyHy X-Received: by 2002:a65:594b:: with SMTP id g11-v6mr20479511pgu.260.1532518799450; Wed, 25 Jul 2018 04:39:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532518799; cv=none; d=google.com; s=arc-20160816; b=uBo6gBcKKEqrAdPLtBweAmkxHOVyimPygT1cp55O5F0Z3QUY1o6PBnvk16uAtQY2cU yEyzd33vDYsXA7/GONPzfSQ9lpH413rCzJSttrTjyZb4iW/NyhF3HVE6PujK1RUhTNLb T1GYAB3vAXzfKhCPE0GN3SB2px3LioVycwiSy8NACP9zyAvLnlLdAiuoJ5W4GSWbq1Ld I2jFIvu2BE5S00pUW5hR7dE+9q5glaUZ89QVcCN1tdZYBzld7nEYjez68zvknBQCELtj BtyV6S9RZkhPfGvfmXliyRtOadtUtefS2TI+EAmHLf8fChwcc6nxp5UbVzzK5wL2Hzj/ gPOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=X/NFpJY+WGqmwbh6p8GFFooFBIafM7PCIlmvmhMQQ9M=; b=u+pCokOGIbPIA5aj+3x1ukKD7pRLw4QG+KeVyp7W/rxEZ/ZMY9jG/LWwJ4FtL6VqJK RP18+1QvSzS3wCGA/58DUn/db0QSCktaYbO2/wxwPB1TNTzqFjbcwPpnv1GyGiEDkbcx dLCFNCAnkIHmC23CBzn8Uk1YG4rZAzn+hBbRAT2l2OxBQrOI/mjskyuxdy24blfqacwI 6Gh/q0BU0RAf2EnV2SaR8w7A2g7Q0pDRQr/RTVsBsV0fMF4XkcvmoKY0hIY1NpID7+yh lA7pMOEA9iwxkbt/cSRPub7ievyON+c/vMiLi08BIg2bqE7vc/IjW6/jTLMZbIIXBx/m TkSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=HdfSix08; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h90-v6si12640430plb.484.2018.07.25.04.39.44; Wed, 25 Jul 2018 04:39:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=HdfSix08; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728974AbeGYMtd (ORCPT + 99 others); Wed, 25 Jul 2018 08:49:33 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:39564 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728942AbeGYMtc (ORCPT ); Wed, 25 Jul 2018 08:49:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=X/NFpJY+WGqmwbh6p8GFFooFBIafM7PCIlmvmhMQQ9M=; b=HdfSix08UbV0jV/Jnq3HiLZyJ cwZ4SV8Q8b2syRAfYy3HgOf/wL5TguQcewpSkJ4HFVmiNdR0KhVTmOISc+gvFHklcjjn0ejROaA2m B2gJcT26cQKxuPk47xw4NFpYKGh9T/oNqi8C5/KsgzI3U/xrEsW2kiPlBb2Zrn75zVdbKNYSc1y/X xjsrU3EVOzfNJjb/lsXP4fZt4t8+uKLqTSi96Rij+g9nyoq9yTVTI1RdisDSRfYFHyRPByHl7MOxn ugKR/hDSrucLJscxAQSrCKveKhCOTkrZifL1rsyuF6s56S1irL92CCdWuaP3yu11nCyArU0Ogumf0 ez77XoTJg==; Received: from clnet-p19-102.ikbnet.co.at ([83.175.77.102] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fiI7S-0006oc-JO; Wed, 25 Jul 2018 11:38:14 +0000 From: Christoph Hellwig To: Konrad Rzeszutek Wilk Cc: iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/6] swiotlb: merge swiotlb_unmap_page and unmap_single Date: Wed, 25 Jul 2018 13:37:59 +0200 Message-Id: <20180725113802.18943-4-hch@lst.de> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180725113802.18943-1-hch@lst.de> References: <20180725113802.18943-1-hch@lst.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Signed-off-by: Christoph Hellwig --- kernel/dma/swiotlb.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c index 06cfc4d00325..03016221fc64 100644 --- a/kernel/dma/swiotlb.c +++ b/kernel/dma/swiotlb.c @@ -812,9 +812,9 @@ dma_addr_t swiotlb_map_page(struct device *dev, struct page *page, * After this call, reads by the cpu to the buffer are guaranteed to see * whatever the device wrote there. */ -static void unmap_single(struct device *hwdev, dma_addr_t dev_addr, - size_t size, enum dma_data_direction dir, - unsigned long attrs) +void swiotlb_unmap_page(struct device *hwdev, dma_addr_t dev_addr, + size_t size, enum dma_data_direction dir, + unsigned long attrs) { phys_addr_t paddr = dma_to_phys(hwdev, dev_addr); @@ -837,13 +837,6 @@ static void unmap_single(struct device *hwdev, dma_addr_t dev_addr, dma_mark_clean(phys_to_virt(paddr), size); } -void swiotlb_unmap_page(struct device *hwdev, dma_addr_t dev_addr, - size_t size, enum dma_data_direction dir, - unsigned long attrs) -{ - unmap_single(hwdev, dev_addr, size, dir, attrs); -} - /* * Make physical memory consistent for a single streaming mode DMA translation * after a transfer. @@ -947,7 +940,7 @@ swiotlb_unmap_sg_attrs(struct device *hwdev, struct scatterlist *sgl, BUG_ON(dir == DMA_NONE); for_each_sg(sgl, sg, nelems, i) - unmap_single(hwdev, sg->dma_address, sg_dma_len(sg), dir, + swiotlb_unmap_page(hwdev, sg->dma_address, sg_dma_len(sg), dir, attrs); } -- 2.18.0