summaryrefslogtreecommitdiff
path: root/exec.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2013-05-20 12:21:07 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2013-05-24 18:43:54 +0200
commitfd2989341e758813351c2fc1446cc8fbcae06ad9 (patch)
tree4821e93ddc274bd4050d6059dce661721c9e8c4d /exec.c
parentf43793c7caab49c68b41c3b8524fc35b4c206856 (diff)
downloadqemu-fd2989341e758813351c2fc1446cc8fbcae06ad9.tar.gz
memory: clean up phys_page_find
Remove the goto. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'exec.c')
-rw-r--r--exec.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/exec.c b/exec.c
index 3fdca46a6a..3a9ddcb41f 100644
--- 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)