make pci_bar_address independent of PCI_BAR_UNMAPPED value. PCI_BAR_UNMAPPED could be arbitrary value which doesn't match possible pci bar. So == PCI_BAR_UNMAPPED check is not good. This patch cleans it up.
Signed-off-by: Isaku Yamahata <yamah...@valinux.co.jp> --- hw/pci.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/hw/pci.c b/hw/pci.c index aed3a24..344d72b 100644 --- a/hw/pci.c +++ b/hw/pci.c @@ -857,8 +857,7 @@ static pcibus_t pci_bar_address(PCIDevice *d, /* XXX: as we cannot support really dynamic mappings, we handle specific values as invalid mappings. */ - if (last_addr <= new_addr || new_addr == 0 || - last_addr == PCI_BAR_UNMAPPED) { + if (last_addr <= new_addr || new_addr == 0 || last_addr == ~(pcibus_t)0) { return PCI_BAR_UNMAPPED; } -- 1.6.5.4