Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3650448yba; Mon, 29 Apr 2019 06:19:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqzZ4C80Ch2P0K1cL6B1RDX2HvmV2lv8UYg3GIplTcTn6I92wz3yYvCESc0fnbDnM6RpG92f X-Received: by 2002:a17:902:43a4:: with SMTP id j33mr62245455pld.307.1556543971493; Mon, 29 Apr 2019 06:19:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556543971; cv=none; d=google.com; s=arc-20160816; b=w01Q3OSFbct+pdIzmCs7u9dXFYKJewynlv9TgtQqNkh2opy5Cq1VCw2LVZmlLvLpm4 0KtT0We3Q4Y0OX2+xGSe2Q1P2vSpN+E9B9JW8WOqcMfZZD1zbZO9mQOjb1Bs/vee7vSE 6W5vMdoduN8JAj8whz4nCFFOMIecxJ9CrkF2E8hK59x3buBcAeqni+Y03xVgHKYuK6eR pARrZ9WBNm7wH0Dq1LTEejvXUW8qckhRtzooCNPirtKWm2YLQPfDfpudymgrd5Hqd88U xHx8mpCJKEZik84WSK4pp+F5joXPBLIAnkBo3kPwJ/S6UZxKhseI1UJM9iS6ZrO/GtB4 QTuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=DA3vGPwc1EGNV3WIbTMgkxVf2GT9NWHz3x5lHxi8Kjk=; b=q6vrNjKWkyNPsHOylLELc3gTA/ElzgrIM9mXrr10YvBY48cByoaQtdRC/K12ECPxEl dU56LB27CIVsQpKaGcudXY1LFDHEb+N63Ww3B0zH4oaKRkx3VS2qB7Y+fbv8EzgvnkaX 1U3dBq+rqod6G0lKMLYE791h8kSrw0pgofpkjFxEbdUG0VGeTYApVlkKGUP4HWCU6W3B 1yXgGMulPX9FyXnYW5i18HX8ov3DiQttk8URpowOx9iVCItlaBCzJA/O8Emyq9w7U1u3 tAru9mYStsB+WJpsd224Qb1RI044gqprb/z6pZVLv080vykVus5eWzJnR8rfuGG/gPz/ foXA== ARC-Authentication-Results: i=1; mx.google.com; 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 c68si19713345pfa.56.2019.04.29.06.19.14; Mon, 29 Apr 2019 06:19:31 -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; 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 S1727764AbfD2NSF (ORCPT + 99 others); Mon, 29 Apr 2019 09:18:05 -0400 Received: from foss.arm.com ([217.140.101.70]:56722 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725838AbfD2NSF (ORCPT ); Mon, 29 Apr 2019 09:18:05 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4441AA78; Mon, 29 Apr 2019 06:18:05 -0700 (PDT) Received: from [10.1.196.75] (e110467-lin.cambridge.arm.com [10.1.196.75]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id CCF433F71A; Mon, 29 Apr 2019 06:18:03 -0700 (PDT) Subject: Re: [PATCH 13/26] iommu/dma: Remove __iommu_dma_free To: Christoph Hellwig Cc: Joerg Roedel , Catalin Marinas , Will Deacon , Tom Lendacky , iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20190422175942.18788-1-hch@lst.de> <20190422175942.18788-14-hch@lst.de> From: Robin Murphy Message-ID: <9c53d0e6-3692-e151-c64b-0070a89ca725@arm.com> Date: Mon, 29 Apr 2019 14:18:02 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190422175942.18788-14-hch@lst.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 22/04/2019 18:59, Christoph Hellwig wrote: > We only have a single caller of this function left, so open code it there. Heh, I even caught myself out for a moment thinking this looked redundant with #18 now, but no :) Reviewed-by: Robin Murphy > Signed-off-by: Christoph Hellwig > --- > drivers/iommu/dma-iommu.c | 21 ++------------------- > 1 file changed, 2 insertions(+), 19 deletions(-) > > diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c > index b8e46e89a60a..4632b9d301a1 100644 > --- a/drivers/iommu/dma-iommu.c > +++ b/drivers/iommu/dma-iommu.c > @@ -534,24 +534,6 @@ static struct page **__iommu_dma_get_pages(void *cpu_addr) > return area->pages; > } > > -/** > - * iommu_dma_free - Free a buffer allocated by iommu_dma_alloc_remap() > - * @dev: Device which owns this buffer > - * @pages: Array of buffer pages as returned by __iommu_dma_alloc_remap() > - * @size: Size of buffer in bytes > - * @handle: DMA address of buffer > - * > - * Frees both the pages associated with the buffer, and the array > - * describing them > - */ > -static void __iommu_dma_free(struct device *dev, struct page **pages, > - size_t size, dma_addr_t *handle) > -{ > - __iommu_dma_unmap(dev, *handle, size); > - __iommu_dma_free_pages(pages, PAGE_ALIGN(size) >> PAGE_SHIFT); > - *handle = DMA_MAPPING_ERROR; > -} > - > /** > * iommu_dma_alloc_remap - Allocate and map a buffer contiguous in IOVA space > * @dev: Device to allocate memory for. Must be a real device > @@ -1034,7 +1016,8 @@ static void iommu_dma_free(struct device *dev, size_t size, void *cpu_addr, > > if (WARN_ON(!pages)) > return; > - __iommu_dma_free(dev, pages, iosize, &handle); > + __iommu_dma_unmap(dev, handle, iosize); > + __iommu_dma_free_pages(pages, size >> PAGE_SHIFT); > dma_common_free_remap(cpu_addr, size, VM_USERMAP); > } else { > __iommu_dma_unmap(dev, handle, iosize); >