From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:48170) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RGTsF-0008KV-J6 for qemu-devel@nongnu.org; Wed, 19 Oct 2011 06:59:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RGTs8-0005sR-J6 for qemu-devel@nongnu.org; Wed, 19 Oct 2011 06:59:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60000) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RGTs7-0005rj-T4 for qemu-devel@nongnu.org; Wed, 19 Oct 2011 06:59:44 -0400 From: Avi Kivity Date: Wed, 19 Oct 2011 12:59:13 +0200 Message-Id: <1319021966-25613-6-git-send-email-avi@redhat.com> In-Reply-To: <1319021966-25613-1-git-send-email-avi@redhat.com> References: <1319021966-25613-1-git-send-email-avi@redhat.com> Subject: [Qemu-devel] [PATCH 05/18] pci: simplify memory region registration List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori , qemu-devel@nongnu.org The two code paths (for ADDRESS_SPACE_IO and ADDRESS_SPACE_MEM) are identical. Unify them. Signed-off-by: Avi Kivity --- hw/pci.c | 13 ++----------- 1 files changed, 2 insertions(+), 11 deletions(-) diff --git a/hw/pci.c b/hw/pci.c index 749e8d8..e8cc1b0 100644 --- a/hw/pci.c +++ b/hw/pci.c @@ -998,17 +998,8 @@ static void pci_update_mappings(PCIDevice *d) } r->addr = new_addr; if (r->addr != PCI_BAR_UNMAPPED) { - if (r->type & PCI_BASE_ADDRESS_SPACE_IO) { - memory_region_add_subregion_overlap(r->address_space, - r->addr, - r->memory, - 1); - } else { - memory_region_add_subregion_overlap(r->address_space, - r->addr, - r->memory, - 1); - } + memory_region_add_subregion_overlap(r->address_space, + r->addr, r->memory, 1); } } } -- 1.7.6.3