public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iommu: Remove trivial ops->capable implementations
@ 2022-02-10 12:29 Robin Murphy
  2022-02-11  1:33 ` Lu Baolu
  2022-02-14 13:05 ` Joerg Roedel
  0 siblings, 2 replies; 3+ messages in thread
From: Robin Murphy @ 2022-02-10 12:29 UTC (permalink / raw)
  To: joro, will; +Cc: iommu, linux-kernel, baolu.lu

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 <robin.murphy@arm.com>
---

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] iommu: Remove trivial ops->capable implementations
  2022-02-10 12:29 [PATCH] iommu: Remove trivial ops->capable implementations Robin Murphy
@ 2022-02-11  1:33 ` Lu Baolu
  2022-02-14 13:05 ` Joerg Roedel
  1 sibling, 0 replies; 3+ messages in thread
From: Lu Baolu @ 2022-02-11  1:33 UTC (permalink / raw)
  To: Robin Murphy, joro, will; +Cc: baolu.lu, iommu, linux-kernel

On 2/10/22 8:29 PM, Robin Murphy wrote:
> 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 <robin.murphy@arm.com>
> ---
> 
> 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,

Looks good to me.

Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com>

Best regards,
baolu

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] iommu: Remove trivial ops->capable implementations
  2022-02-10 12:29 [PATCH] iommu: Remove trivial ops->capable implementations Robin Murphy
  2022-02-11  1:33 ` Lu Baolu
@ 2022-02-14 13:05 ` Joerg Roedel
  1 sibling, 0 replies; 3+ messages in thread
From: Joerg Roedel @ 2022-02-14 13:05 UTC (permalink / raw)
  To: Robin Murphy; +Cc: will, iommu, linux-kernel, baolu.lu

On Thu, Feb 10, 2022 at 12:29:05PM +0000, Robin Murphy wrote:
> 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 <robin.murphy@arm.com>
> ---
> 
> 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(-)

Applied, thanks Robin.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-02-14 13:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-10 12:29 [PATCH] iommu: Remove trivial ops->capable implementations Robin Murphy
2022-02-11  1:33 ` Lu Baolu
2022-02-14 13:05 ` Joerg Roedel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox