pci: align ioport unmap error handling to ioport map
authorDavid Marchand <david.marchand@6wind.com>
Tue, 15 Mar 2016 06:29:11 +0000 (07:29 +0100)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Wed, 16 Mar 2016 20:20:37 +0000 (21:20 +0100)
Same idea as commit bd80d4730aca ("pci: rework ioport map error handling").

Signed-off-by: David Marchand <david.marchand@6wind.com>
lib/librte_eal/linuxapp/eal/eal_pci.c

index 9f75252..77d70d9 100644 (file)
@@ -684,12 +684,11 @@ rte_eal_pci_ioport_write(struct rte_pci_ioport *p,
 int
 rte_eal_pci_ioport_unmap(struct rte_pci_ioport *p)
 {
-       int ret;
+       int ret = -1;
 
        switch (p->dev->kdrv) {
 #ifdef VFIO_PRESENT
        case RTE_KDRV_VFIO:
-               ret = -1;
                if (pci_vfio_is_enabled())
                        ret = pci_vfio_ioport_unmap(p);
                break;
@@ -702,8 +701,6 @@ rte_eal_pci_ioport_unmap(struct rte_pci_ioport *p)
 #if defined(RTE_ARCH_X86)
                /* special case for x86 ... nothing to do */
                ret = 0;
-#else
-               ret = -1;
 #endif
                break;
        }