pci: simplify memory region registration
PATCH 1/1 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 <[email protected]>
--- hw/pci.c | 13 ++----------- 1 files changed, 2 insertions(+), 11 deletions(-)
hw/pci.c +2 -11
@@ -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 ); } } }
Signature · 1 line
1.7.6.3
Michael S. Tsirkin
AppliedQuoted 4 lines · Avi Kivity
The two code paths (for
ADDRESS_SPACE_IOandADDRESS_SPACE_MEM) are identical. Unify them.Signed-off-by Avi Kivity <[email protected]>
Applied, thanks
Quoted 30 lines
--- hw/pci.c | 13 ++----------- 1 files changed, 2 insertions(+), 11 deletions(-)hw/pci.c +2
-11@@ -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 ); } } }Signature · 1 line
1.7.6.3