virtio: fix check when mapping PCI resources
[dpdk.git] / drivers / net / virtio / virtio_pci.c
index 4e9928a..b4d4476 100644 (file)
@@ -306,7 +306,7 @@ legacy_virtio_has_msix(const struct rte_pci_addr *loc)
        if (d)
                closedir(d);
 
-       return (d != NULL);
+       return d != NULL;
 }
 
 /* Extract I/O port numbers from sysfs */
@@ -439,7 +439,7 @@ legacy_virtio_resource_init(struct rte_pci_device *pci_dev)
 
 #else
 static int
-legayc_virtio_has_msix(const struct rte_pci_addr *loc __rte_unused)
+legacy_virtio_has_msix(const struct rte_pci_addr *loc __rte_unused)
 {
        /* nic_uio does not enable interrupts, return 0 (false). */
        return 0;
@@ -795,7 +795,7 @@ virtio_read_caps(struct rte_pci_device *dev, struct virtio_hw *hw)
        struct virtio_pci_cap cap;
        int ret;
 
-       if (rte_eal_pci_map_device(dev) < 0) {
+       if (rte_eal_pci_map_device(dev)) {
                PMD_INIT_LOG(DEBUG, "failed to map pci device!");
                return -1;
        }