Re: [PATCH v12 5/5] iommu: Remove mode argument from iommu_set_dma_strict()

From: John Garry
Date: Mon Jun 14 2021 - 03:52:41 EST


On 12/06/2021 03:23, Lu Baolu wrote:
On 2021/6/11 20:20, John Garry wrote:
diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index ccbd5d4c1a50..146cb71c7441 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -350,10 +350,9 @@ static int __init iommu_dma_setup(char *str)
  }
  early_param("iommu.strict", iommu_dma_setup);
-void iommu_set_dma_strict(bool strict)
+void iommu_set_dma_strict(void)
  {
-    if (strict || !(iommu_cmd_line & IOMMU_CMD_LINE_STRICT))
-        iommu_dma_strict = strict;
+        iommu_dma_strict = true;
  }

Will this change break the functionality of iommu.strict?


No, iommu_dma_strict is written directly in iommu_dma_setup() for iommu.strict cmdline processing.

Here I'm just saying that anyone that who uses iommu_set_dma_strict(bool strict) always passes true, so I just remove that argument and simplify that function.

Thanks,
John