]> xenbits.xensource.com Git - people/sstabellini/xen-unstable.git/.git/commitdiff
x86/mm: drop redundant local variable from _get_page_type()
authorJan Beulich <jbeulich@suse.com>
Fri, 5 Apr 2019 08:15:10 +0000 (10:15 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 5 Apr 2019 08:15:10 +0000 (10:15 +0200)
Instead of the separate iommu_ret, the general rc can be used even for
the IOMMU operations.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/mm.c

index a88cd9ce7ca2a3645a7d5a5038e4dbc91e21dc7b..45fadbab61f1bf4895357e5f2b6bddd5857f1a66 100644 (file)
@@ -2813,7 +2813,7 @@ static int _get_page_type(struct page_info *page, unsigned long type,
                           bool preemptible)
 {
     unsigned long nx, x, y = page->u.inuse.type_info;
-    int rc = 0, iommu_ret = 0;
+    int rc = 0;
 
     ASSERT(!(type & ~(PGT_type_mask | PGT_pae_xen_l2)));
     ASSERT(!in_irq());
@@ -2925,18 +2925,14 @@ static int _get_page_type(struct page_info *page, unsigned long type,
             mfn_t mfn = page_to_mfn(page);
 
             if ( (x & PGT_type_mask) == PGT_writable_page )
-                iommu_ret = iommu_legacy_unmap(d, _dfn(mfn_x(mfn)),
-                                               PAGE_ORDER_4K);
+                rc = iommu_legacy_unmap(d, _dfn(mfn_x(mfn)), PAGE_ORDER_4K);
             else if ( type == PGT_writable_page )
-                iommu_ret = iommu_legacy_map(d, _dfn(mfn_x(mfn)), mfn,
-                                             PAGE_ORDER_4K,
-                                             IOMMUF_readable |
-                                             IOMMUF_writable);
+                rc = iommu_legacy_map(d, _dfn(mfn_x(mfn)), mfn, PAGE_ORDER_4K,
+                                      IOMMUF_readable | IOMMUF_writable);
 
-            if ( unlikely(iommu_ret) )
+            if ( unlikely(rc) )
             {
                 _put_page_type(page, false, NULL);
-                rc = iommu_ret;
                 goto out;
             }
         }