mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
IOMMU: simplify unmap-on-error in iommu_map()
As of 68a8aa5d72 ("iommu: make map and unmap take a page count,
similar to flush") there's no need anymore to have a loop here.
Suggested-by: Roger Pau Monné <roger.pau@citrix.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
This commit is contained in:
1 parent
d029b9cf13
commit
09e4ac7bc0
1 file changed
+3
-5
@@ -308,11 +308,9 @@ int iommu_map(struct domain *d, dfn_t dfn, mfn_t mfn,
|
||||
d->domain_id, dfn_x(dfn_add(dfn, i)),
|
||||
mfn_x(mfn_add(mfn, i)), rc);
|
||||
|
||||
while ( i-- )
|
||||
/* if statement to satisfy __must_check */
|
||||
if ( iommu_call(hd->platform_ops, unmap_page, d, dfn_add(dfn, i),
|
||||
flush_flags) )
|
||||
continue;
|
||||
/* while statement to satisfy __must_check */
|
||||
while ( iommu_unmap(d, dfn, i, flush_flags) )
|
||||
break;
|
||||
|
||||
if ( !is_hardware_domain(d) )
|
||||
domain_crash(d);
|
||||
|
||||