the "found=1" should be "there are other device owned by the domain", the
comments is put at wrong place and make the code reviewing confuse, so move it
to the correct place.

Signed-off-by: Youquan Song <[email protected]>
---
 drivers/iommu/intel-iommu.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index 9cd522f..aa821fc 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -3813,10 +3813,6 @@ static void domain_remove_one_dev_info(struct 
dmar_domain *domain,
                                continue;
                }
 
-               /* if there is no other devices under the same iommu
-                * owned by this domain, clear this iommu in iommu_bmp
-                * update iommu count and coherency
-                */
                if (iommu == device_to_iommu(info->segment, info->bus,
                                            info->devfn))
                        found = 1;
@@ -3824,6 +3820,10 @@ static void domain_remove_one_dev_info(struct 
dmar_domain *domain,
 
        spin_unlock_irqrestore(&device_domain_lock, flags);
 
+       /* if there is no other devices under the same iommu
+        * owned by this domain, clear this iommu in iommu_bmp
+        * update iommu count and coherency
+        */
        if (found == 0) {
                unsigned long tmp_flags;
                spin_lock_irqsave(&domain->iommu_lock, tmp_flags);
-- 
1.7.7.4

_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu

Reply via email to