qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 02/11] pci: clean up pci_bar_address()


From: Isaku Yamahata
Subject: [Qemu-devel] [PATCH 02/11] pci: clean up pci_bar_address()
Date: Mon, 14 Dec 2009 21:48:17 +0900

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 <address@hidden>
---
 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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]