Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2826944pxb; Thu, 10 Feb 2022 06:28:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJyKphRVFXYT5wqFYmtNES7MNaM+/r2VUP3u89RjQVvJ88biMZMZmAOG6KQGOYdSTPQcaukB X-Received: by 2002:a17:902:da88:: with SMTP id j8mr7726991plx.105.1644503337106; Thu, 10 Feb 2022 06:28:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644503337; cv=none; d=google.com; s=arc-20160816; b=MOlneI0+IZi5OM877KWc7HK072dEWqWrc3aSrDbcSVPwUlW61GoZ0qmtTKQvvBmUsA Cl7B0LvtuJut8+DRj5WAD2CYxk9re+tKBnU+DzWwXZ7BQciqGUhXCccCs4D98MHQ6w3P 2gm5DAtUhOT0zW0YOcqLgd7XhqYuRYgT6BKJfiT9At/SfuOwwa2VwZBavwOuDdP0PG6p lPHj2xDEsngKTh0k297hWiUD8aGlxhrKnqoue+92aJUEn1q//S8kFeoZnTpAnj1HTDaN IdrEwHfpNmANU6U8zTlaJGyxxw6nGngDD+FQUXjUd1qHEd41HYsIBlKx3IaGQjHLh6Tw DVCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=YfxRJu23LcOMnT8o9dgQbTKQpLNntgEvFzogT6/ly3c=; b=hy3OSGhVn1BkrIluADEzu8EB37nzupzuO38CMbHIRrmd70hkZueQdv/164UFDXjJTw b29rSh2+FZB5TcVsJ4Qz7d1B5fsnrDjzv5X6M8tJ5EX+HaKEkW+X2FvlSHGUAwKOyuad TBvk7jET+cKX+PzIXlZyAhs49iZAxi74yuusm/TpwLmImPqkcJUiXWq/vaF6o1VkFxb0 /ECZQcq0s5l7vDB7G6oXGe8xbNif1D7Pi8cubxSTSqQpimnBOMtyHRolHddQzrGQySWo 2MIKsOrqiKGdQh33dNW9cNtcgvFZWS9ZTOEP6DrfIBEk12W4qNcYqkl2wz1tV43dq+uK bVjg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h20si3061483pgi.223.2022.02.10.06.28.41; Thu, 10 Feb 2022 06:28:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241538AbiBJM3L (ORCPT + 99 others); Thu, 10 Feb 2022 07:29:11 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:50958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241204AbiBJM3J (ORCPT ); Thu, 10 Feb 2022 07:29:09 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1F46C21B8 for ; Thu, 10 Feb 2022 04:29:10 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id DBE11113E; Thu, 10 Feb 2022 04:29:09 -0800 (PST) Received: from e121345-lin.cambridge.arm.com (e121345-lin.cambridge.arm.com [10.1.196.40]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 2229C3F73B; Thu, 10 Feb 2022 04:29:09 -0800 (PST) From: Robin Murphy To: joro@8bytes.org, will@kernel.org Cc: iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, baolu.lu@linux.intel.com Subject: [PATCH] iommu: Remove trivial ops->capable implementations Date: Thu, 10 Feb 2022 12:29:05 +0000 Message-Id: <8413578c6f8a7cf75530b00cba8f10f5b88f8517.1644495614.git.robin.murphy@arm.com> X-Mailer: git-send-email 2.28.0.dirty MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Implementing ops->capable to always return false is pointless since it's the default behaviour anyway. Clean up the unnecessary implementations. Signed-off-by: Robin Murphy --- Spinning this out of my bus ops stuff (currently 30 patches and counting...) since it would be better off alongside Baolu's cleanup series to avoid conflicts, and I want to depend on those patches for dev_iommu_ops() anyway. drivers/iommu/msm_iommu.c | 6 ------ drivers/iommu/tegra-gart.c | 6 ------ drivers/iommu/tegra-smmu.c | 6 ------ 3 files changed, 18 deletions(-) diff --git a/drivers/iommu/msm_iommu.c b/drivers/iommu/msm_iommu.c index 06bde6b66732..22061ddbd5df 100644 --- a/drivers/iommu/msm_iommu.c +++ b/drivers/iommu/msm_iommu.c @@ -558,11 +558,6 @@ static phys_addr_t msm_iommu_iova_to_phys(struct iommu_domain *domain, return ret; } -static bool msm_iommu_capable(enum iommu_cap cap) -{ - return false; -} - static void print_ctx_regs(void __iomem *base, int ctx) { unsigned int fsr = GET_FSR(base, ctx); @@ -672,7 +667,6 @@ irqreturn_t msm_iommu_fault_handler(int irq, void *dev_id) } static struct iommu_ops msm_iommu_ops = { - .capable = msm_iommu_capable, .domain_alloc = msm_iommu_domain_alloc, .domain_free = msm_iommu_domain_free, .attach_dev = msm_iommu_attach_dev, diff --git a/drivers/iommu/tegra-gart.c b/drivers/iommu/tegra-gart.c index 6a358f92c7e5..bbd287d19324 100644 --- a/drivers/iommu/tegra-gart.c +++ b/drivers/iommu/tegra-gart.c @@ -238,11 +238,6 @@ static phys_addr_t gart_iommu_iova_to_phys(struct iommu_domain *domain, return pte & GART_PAGE_MASK; } -static bool gart_iommu_capable(enum iommu_cap cap) -{ - return false; -} - static struct iommu_device *gart_iommu_probe_device(struct device *dev) { if (!dev_iommu_fwspec_get(dev)) @@ -276,7 +271,6 @@ static void gart_iommu_sync(struct iommu_domain *domain, } static const struct iommu_ops gart_iommu_ops = { - .capable = gart_iommu_capable, .domain_alloc = gart_iommu_domain_alloc, .domain_free = gart_iommu_domain_free, .attach_dev = gart_iommu_attach_dev, diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c index e900e3c46903..43df44f918a1 100644 --- a/drivers/iommu/tegra-smmu.c +++ b/drivers/iommu/tegra-smmu.c @@ -272,11 +272,6 @@ static void tegra_smmu_free_asid(struct tegra_smmu *smmu, unsigned int id) clear_bit(id, smmu->asids); } -static bool tegra_smmu_capable(enum iommu_cap cap) -{ - return false; -} - static struct iommu_domain *tegra_smmu_domain_alloc(unsigned type) { struct tegra_smmu_as *as; @@ -967,7 +962,6 @@ static int tegra_smmu_of_xlate(struct device *dev, } static const struct iommu_ops tegra_smmu_ops = { - .capable = tegra_smmu_capable, .domain_alloc = tegra_smmu_domain_alloc, .domain_free = tegra_smmu_domain_free, .attach_dev = tegra_smmu_attach_dev, -- 2.28.0.dirty