Received: from eggs.gnu.org ([208.118.235.92]:45038) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UekGl-0004Zd-V9 for qemu-devel@nongnu.org; Tue, 21 May 2013 06:58:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UekGk-0005Pe-5R for qemu-devel@nongnu.org; Tue, 21 May 2013 06:58:15 -0400 Received: from mail-ee0-f46.google.com ([74.125.83.46]:35907) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UekGk-0005PX-07 for qemu-devel@nongnu.org; Tue, 21 May 2013 06:58:14 -0400 Received: by mail-ee0-f46.google.com with SMTP id e49so309158eek.33 for ; Tue, 21 May 2013 03:58:13 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Tue, 21 May 2013 12:57:17 +0200 Message-Id: <1369133851-1894-17-git-send-email-pbonzini@redhat.com> In-Reply-To: <1369133851-1894-1-git-send-email-pbonzini@redhat.com> References: <1369133851-1894-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 16/30] memory: clean up phys_page_find List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, jan.kiszka@gmail.com, David Gibson Remove the goto. Signed-off-by: Paolo Bonzini --- exec.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/exec.c b/exec.c index 8f1b507..82da067 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) -- 1.8.1.4