From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:44996) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UfvPD-0002QT-AN for qemu-devel@nongnu.org; Fri, 24 May 2013 13:03:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UfvP8-000195-E1 for qemu-devel@nongnu.org; Fri, 24 May 2013 13:03:51 -0400 Received: from mail-ee0-f45.google.com ([74.125.83.45]:53821) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UfvP8-00018u-8R for qemu-devel@nongnu.org; Fri, 24 May 2013 13:03:46 -0400 Received: by mail-ee0-f45.google.com with SMTP id l10so2647197eei.18 for ; Fri, 24 May 2013 10:03:45 -0700 (PDT) Received: from playground.lan (net-37-117-138-128.cust.dsl.vodafone.it. [37.117.138.128]) by mx.google.com with ESMTPSA id z52sm24872219eea.1.2013.05.24.10.03.43 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 24 May 2013 10:03:44 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Fri, 24 May 2013 19:03:07 +0200 Message-Id: <1369414987-8839-16-git-send-email-pbonzini@redhat.com> In-Reply-To: <1369414987-8839-1-git-send-email-pbonzini@redhat.com> References: <1369414987-8839-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 15/15] memory: clean up phys_page_find List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Remove the goto. Reviewed-by: Peter Maydell Signed-off-by: Paolo Bonzini --- exec.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/exec.c b/exec.c index 3fdca46..3a9ddcb 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