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:
Jan Beulich committed 2022-05-20 12:21:49 +02:00
1 parent d029b9cf13
commit 09e4ac7bc0
1 file changed
+3 -5
+3 -5
View File
@@ -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);
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.