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>
This commit is contained in:
Avi Kivity 2011-08-11 14:40:58 +03:00
parent adfc39eaef
commit 8b881e776a
1 changed files with 2 additions and 11 deletions

View File

@ -998,17 +998,8 @@ static void pci_update_mappings(PCIDevice *d)
} }
r->addr = new_addr; r->addr = new_addr;
if (r->addr != PCI_BAR_UNMAPPED) { if (r->addr != PCI_BAR_UNMAPPED) {
if (r->type & PCI_BASE_ADDRESS_SPACE_IO) {
memory_region_add_subregion_overlap(r->address_space, memory_region_add_subregion_overlap(r->address_space,
r->addr, r->addr, r->memory, 1);
r->memory,
1);
} else {
memory_region_add_subregion_overlap(r->address_space,
r->addr,
r->memory,
1);
}
} }
} }
} }