Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5074037ybv; Mon, 17 Feb 2020 11:41:52 -0800 (PST) X-Google-Smtp-Source: APXvYqz9tXkGg6+FlAFf9bOLCbZ6CI0Tq3k2itMfeDDblo25CYUoHJGdYV9+nSKSTx5HC80vBks2 X-Received: by 2002:a05:6808:218:: with SMTP id l24mr366788oie.108.1581968512729; Mon, 17 Feb 2020 11:41:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581968512; cv=none; d=google.com; s=arc-20160816; b=fj5RArxlBH3T4MwsZxQSP0bM6Pv8+L20B9e4jlASbU0sHOKf+E1A0AzNDMWC6D75wL zLI/gItAgatJESrOp7fIKHLOXi7ENyQkqI1skmVErRMSJoiWuETxA2ctZ6gzCd2npGaX ym64GYFpZOylGfNAMC+U48nVZDH0Q729q/6IVDlP2ffJe+UV1w61+n7I6YSdVMpqihM6 bqbRy4rqOJQX2+FJ/E956myb1ho+0yt2mKXEEmdfM68nUZv8yuSskvUYeDQTWCFQK740 PUsfp2d4ygotgsDf9K63kGwqTaRX7cVhQpUDUYDrcAypFNaOoHeV5QEY0FVy/7nEBL9r D5Bw== 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; bh=WTKVTFgWZLK9tEeCpP1Fob0j2srwJ/NoE1m516IGhZI=; b=b/5Al1uIN6ESFXSQN6lRvO+Ib7h/kACflBgsObzK2rR9aKEmhKrIqe2twLEHNrb0kD Qm336j/o92467RmazZeNqe+z0fWUYAHylf7XLC8uB46og14wZHrXsxtpwRe6wQe5G52A blI1xoyjK7mg2VDw+OH78/Q5UrbbCkSdhNh3qzbWtBCgFFMBaGTRzUgMtVwUadKdkz3c JSS46D9a8BuJ208/0G5j3siFpBo4r9Q7nUqB3B0bE5Bs917Fnu9o0aWw/mK0BRchXesw dPkmGnuJpmU1CaQaslnpVmFNI19JbGZlOnH7qBEVM+3iFgIXEM1JCTsG0eBmOjD2V5zZ tW6A== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 24si6311288oip.248.2020.02.17.11.41.41; Mon, 17 Feb 2020 11:41:52 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729558AbgBQTjJ (ORCPT + 99 others); Mon, 17 Feb 2020 14:39:09 -0500 Received: from 8bytes.org ([81.169.241.247]:54526 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729334AbgBQTjI (ORCPT ); Mon, 17 Feb 2020 14:39:08 -0500 Received: by theia.8bytes.org (Postfix, from userid 1000) id 3973D608; Mon, 17 Feb 2020 20:39:07 +0100 (CET) From: Joerg Roedel To: Lu Baolu , David Woodhouse Cc: Joerg Roedel , jroedel@suse.de, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/5] iommu/vt-d: Remove deferred_attach_domain() Date: Mon, 17 Feb 2020 20:38:57 +0100 Message-Id: <20200217193858.26990-5-joro@8bytes.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200217193858.26990-1-joro@8bytes.org> References: <20200217193858.26990-1-joro@8bytes.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Joerg Roedel The function is now only a wrapper around find_domain(). Remove the function and call find_domain() directly at the call-sites. Signed-off-by: Joerg Roedel --- drivers/iommu/intel-iommu.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index 32f43695a22b..16e47ca505eb 100644 --- a/drivers/iommu/intel-iommu.c +++ b/drivers/iommu/intel-iommu.c @@ -2539,11 +2539,6 @@ static void do_deferred_attach(struct device *dev) intel_iommu_attach_device(domain, dev); } -static struct dmar_domain *deferred_attach_domain(struct device *dev) -{ - return find_domain(dev); -} - static inline struct device_domain_info * dmar_search_domain_by_dev_info(int segment, int bus, int devfn) { @@ -3643,7 +3638,7 @@ static dma_addr_t __intel_map_single(struct device *dev, phys_addr_t paddr, BUG_ON(dir == DMA_NONE); - domain = deferred_attach_domain(dev); + domain = find_domain(dev); if (!domain) return DMA_MAPPING_ERROR; @@ -3863,7 +3858,7 @@ static int intel_map_sg(struct device *dev, struct scatterlist *sglist, int nele if (!iommu_need_mapping(dev)) return dma_direct_map_sg(dev, sglist, nelems, dir, attrs); - domain = deferred_attach_domain(dev); + domain = find_domain(dev); if (!domain) return 0; @@ -3958,7 +3953,7 @@ bounce_map_single(struct device *dev, phys_addr_t paddr, size_t size, int prot = 0; int ret; - domain = deferred_attach_domain(dev); + domain = find_domain(dev); if (WARN_ON(dir == DMA_NONE || !domain)) return DMA_MAPPING_ERROR; -- 2.17.1