Skip to contentSkip to conversation

apb_pci: minor cleanup

PATCH Applied Michael S. Tsirkin 2 participants 2 messages Feb 22, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 apb_pci: minor cleanup

pci_data_write ignores high 8 bit in address,
so there seems to be no need to set them
in apb_pci.

---

Blue Swirl, please consider the following (untested) patch. Thanks!

 hw/apb_pci.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
hw/apb_pci.c +2 -4
index ebfcd41..f14b432 100644
@@ -187,8 +187,7 @@ static void apb_pci_config_write(APBState *s, target_phys_addr_t addr,
                                  uint32_t val, int size)
 {
     APB_DPRINTF("%s: addr " TARGET_FMT_lx " val %x\n", __func__, addr, val);
-    pci_data_write(s->host_state.bus, (addr & 0x00ffffff) | (1u << 31), val,
-                   size);
+    pci_data_write(s->host_state.bus, addr, val, size);
 }
 
 static uint32_t apb_pci_config_read(APBState *s, target_phys_addr_t addr,
@@ -196,8 +195,7 @@ static uint32_t apb_pci_config_read(APBState *s, target_phys_addr_t addr,
 {
     uint32_t ret;
 
-    ret = pci_data_read(s->host_state.bus, (addr & 0x00ffffff) | (1u << 31),
-                        size);
+    ret = pci_data_read(s->host_state.bus, addr, size);
     APB_DPRINTF("%s: addr " TARGET_FMT_lx " -> %x\n", __func__, addr, ret);
     return ret;
 }
Signature · 1 line
1.7.0.18.g0d53a5
Applied
#1 lore raw

Thanks, applied.

Quoted 41 lines · Michael S. Tsirkin

pci_data_write ignores high 8 bit in address,
so there seems to be no need to set them
in apb_pci.

---

Blue Swirl, please consider the following (untested) patch. Thanks!

  hw/apb_pci.c |    6 ++----
  1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/hw/apb_pci.c b/hw/apb_pci.c
index ebfcd41..f14b432 100644
--- a/hw/apb_pci.c
+++ b/hw/apb_pci.c
@@ -187,8 +187,7 @@ static void apb_pci_config_write(APBState *s, target_phys_addr_t addr,
uint32_t val, int size)

  {
     APB_DPRINTF("%s: addr " TARGET_FMT_lx " val %x\n", __func__, addr, val);

- pci_data_write(s->host_state.bus, (addr & 0x00ffffff) | (1u << 31), val,
- size);
+ pci_data_write(s->host_state.bus, addr, val, size);
}

static uint32_t apb_pci_config_read(APBState *s, target_phys_addr_t addr,
@@ -196,8 +195,7 @@ static uint32_t apb_pci_config_read(APBState *s, target_phys_addr_t addr,

  {
     uint32_t ret;

- ret = pci_data_read(s->host_state.bus, (addr & 0x00ffffff) | (1u << 31),
- size);

 +    ret = pci_data_read(s->host_state.bus, addr, size);
     APB_DPRINTF("%s: addr " TARGET_FMT_lx " -> %x\n", __func__, addr, ret);
     return ret;

}

--
1.7.0.18.g0d53a5