RE: [PATCH v2 4/5] vfio/iommu_type1: Clean up update_dirty_scope in detach_group()

From
Tian, Kevin <kevin.tian@intel.com>
Date
2022-06-16 06:45:23
Also in
kvm, linux-arm-msm, linux-iommu, linux-mediatek, linux-s390, linux-tegra, lkml, virtualization
Reply to
Nicolin Chen, 2022-06-16
From: Nicolin Chen
Sent: Thursday, June 16, 2022 8:03 AM

All devices in emulated_iommu_groups have pinned_page_dirty_scope
set, so the update_dirty_scope in the first list_for_each_entry
is always false. Clean it up, and move the "if update_dirty_scope"
part from the detach_group_done routine to the domain_list part.

Rename the "detach_group_done" goto label accordingly.

Suggested-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Nicolin Chen <redacted>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>, with one nit:
quoted hunk ↗ jump to hunk
@@ -2469,7 +2467,7 @@ static void vfio_iommu_type1_detach_group(void
*iommu_data,
 			WARN_ON(iommu->notifier.head);
 			vfio_iommu_unmap_unpin_all(iommu);
 		}
-		goto detach_group_done;
+		goto out_unlock;
...
quoted hunk ↗ jump to hunk
+out_unlock:
 	mutex_unlock(&iommu->lock);
 }
I'd just replace the goto with a direct unlock and then return there. 
the readability is slightly better.


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Thread (30 messages) 30 messages, 6 authors, last reply 2022-06-24
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help