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>
This commit is contained in:
parent
f43793c7ca
commit
fd2989341e
8
exec.c
8
exec.c
|
@ -187,19 +187,15 @@ MemoryRegionSection *phys_page_find(AddressSpaceDispatch *d, hwaddr index)
|
||||||
PhysPageEntry lp = d->phys_map;
|
PhysPageEntry lp = d->phys_map;
|
||||||
PhysPageEntry *p;
|
PhysPageEntry *p;
|
||||||
int i;
|
int i;
|
||||||
uint16_t s_index = phys_section_unassigned;
|
|
||||||
|
|
||||||
for (i = P_L2_LEVELS - 1; i >= 0 && !lp.is_leaf; i--) {
|
for (i = P_L2_LEVELS - 1; i >= 0 && !lp.is_leaf; i--) {
|
||||||
if (lp.ptr == PHYS_MAP_NODE_NIL) {
|
if (lp.ptr == PHYS_MAP_NODE_NIL) {
|
||||||
goto not_found;
|
return &phys_sections[phys_section_unassigned];
|
||||||
}
|
}
|
||||||
p = phys_map_nodes[lp.ptr];
|
p = phys_map_nodes[lp.ptr];
|
||||||
lp = p[(index >> (i * L2_BITS)) & (L2_SIZE - 1)];
|
lp = p[(index >> (i * L2_BITS)) & (L2_SIZE - 1)];
|
||||||
}
|
}
|
||||||
|
return &phys_sections[lp.ptr];
|
||||||
s_index = lp.ptr;
|
|
||||||
not_found:
|
|
||||||
return &phys_sections[s_index];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool memory_region_is_unassigned(MemoryRegion *mr)
|
bool memory_region_is_unassigned(MemoryRegion *mr)
|
||||||
|
|
Loading…
Reference in a new issue