summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2011-08-11 14:40:58 +0300
committerAvi Kivity <avi@redhat.com>2011-10-17 15:59:17 +0200
commit8b881e776a45cc1ee18f4bc8182bbc1d2aed56e8 (patch)
tree4c3ebd127478145ddd767e8a5e1f8f19c555391e /hw
parentadfc39eaeff3da25376f7d735ac97ee25f933dcc (diff)
downloadqemu-8b881e776a45cc1ee18f4bc8182bbc1d2aed56e8.tar.gz
qemu-8b881e776a45cc1ee18f4bc8182bbc1d2aed56e8.tar.bz2
qemu-8b881e776a45cc1ee18f4bc8182bbc1d2aed56e8.zip
pci: simplify memory region registration
The two code paths (for ADDRESS_SPACE_IO and ADDRESS_SPACE_MEM) are identical. Unify them. Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/pci.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/hw/pci.c b/hw/pci.c
index 749e8d86ca..e8cc1b046f 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);
}
}
}