]> Git Repo - qemu.git/commitdiff
memory: clean up phys_page_find
authorPaolo Bonzini <[email protected]>
Mon, 20 May 2013 10:21:07 +0000 (12:21 +0200)
committerPaolo Bonzini <[email protected]>
Fri, 24 May 2013 16:43:54 +0000 (18:43 +0200)
Remove the goto.

Reviewed-by: Peter Maydell <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
exec.c

diff --git a/exec.c b/exec.c
index 3fdca46a6afc139d7917e655368262d979deb667..3a9ddcb41f4c477c8247ad9ebfa7ebc061935bae 100644 (file)
--- a/exec.c
+++ b/exec.c
@@ -187,19 +187,15 @@ MemoryRegionSection *phys_page_find(AddressSpaceDispatch *d, hwaddr index)
     PhysPageEntry lp = d->phys_map;
     PhysPageEntry *p;
     int i;
-    uint16_t s_index = phys_section_unassigned;
 
     for (i = P_L2_LEVELS - 1; i >= 0 && !lp.is_leaf; i--) {
         if (lp.ptr == PHYS_MAP_NODE_NIL) {
-            goto not_found;
+            return &phys_sections[phys_section_unassigned];
         }
         p = phys_map_nodes[lp.ptr];
         lp = p[(index >> (i * L2_BITS)) & (L2_SIZE - 1)];
     }
-
-    s_index = lp.ptr;
-not_found:
-    return &phys_sections[s_index];
+    return &phys_sections[lp.ptr];
 }
 
 bool memory_region_is_unassigned(MemoryRegion *mr)
This page took 0.02877 seconds and 4 git commands to generate.