Skip to contentSkip to conversation

x86/mm: Simplify promote_l4_table()'s exit semantics

PATCH In review Andrew Cooper 2 participants 2 messages Dec 16, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/mm: Simplify promote_l4_table()'s exit semantics

promote_l4_table() is different from its lower level helpers, by having an extra return path out of the middle of the loop in the case of a failure.

Break from the loop, which is consistent with the other helpers, and functionally equivalent.

---
CC: Jan Beulich <[email protected]>
CC: George Dunlap <[email protected]>

---
 xen/arch/x86/mm.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
xen/arch/x86/mm.c +1 -4
index c14c677a62..594f1bd290 100644
@@ -1856,10 +1856,7 @@ static int promote_l4_table(struct page_info *page)
             }
         }
         if ( rc < 0 )
-        {
-            unmap_domain_page(pl4e);
-            return rc;
-        }
+            break;
 
         pl4e[i] = adjust_guest_l4e(l4e, d);
     }
Signature · 7 lines
2.11.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Andrew Cooper

promote_l4_table() is different from its lower level helpers, by having an extra return path out of the middle of the loop in the case of a failure.

Break from the loop, which is consistent with the other helpers, and functionally equivalent.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel