ethdev: fix cast for C++ compatibility
authorBruce Richardson <bruce.richardson@intel.com>
Tue, 15 Feb 2022 17:30:27 +0000 (17:30 +0000)
committerThomas Monjalon <thomas@monjalon.net>
Tue, 22 Feb 2022 13:47:49 +0000 (14:47 +0100)
C++ does not allow implicit conversion to/from void*,
so we need an explicit cast to allow the driver SDK header
to be included from C++ code.

Fixes: e489007a411c ("ethdev: add generic create/destroy ethdev APIs")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
lib/ethdev/ethdev_pci.h

index 6130bcb..0549842 100644 (file)
@@ -50,8 +50,9 @@ rte_eth_copy_pci_info(struct rte_eth_dev *eth_dev,
 }
 
 static inline int
-eth_dev_pci_specific_init(struct rte_eth_dev *eth_dev, void *bus_device) {
-       struct rte_pci_device *pci_dev = bus_device;
+eth_dev_pci_specific_init(struct rte_eth_dev *eth_dev, void *bus_device)
+{
+       struct rte_pci_device *pci_dev = (struct rte_pci_device *)bus_device;
 
        if (!pci_dev)
                return -ENODEV;