Patchwork [PULL,19/28] pci: simplify memory region registration

login
register
mail settings
Submitter Avi Kivity
Date Sept. 12, 2011, 10:50 a.m.
Message ID <1315824666-4214-20-git-send-email-avi@redhat.com>
Download mbox | patch
Permalink /patch/114312/
State New
Headers show

Comments

Avi Kivity - Sept. 12, 2011, 10:50 a.m.
The two code paths (for ADDRESS_SPACE_IO and ADDRESS_SPACE_MEM) are
identical.  Unify them.

Signed-off-by: Avi Kivity <avi@redhat.com>
---
 hw/pci.c |   13 ++-----------
 1 files changed, 2 insertions(+), 11 deletions(-)

Patch

diff --git a/hw/pci.c b/hw/pci.c
index d23fa74..a4d7761 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -1048,17 +1048,8 @@  static void pci_update_mappings(PCIDevice *d)
              * Teach them such cases, such that filtered_size < size and
              * addr & (size - 1) != 0.
              */
-            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);
         }
     }
 }