Skip to content

Commit

Permalink
ethdev: fix cast for C++ compatibility
Browse files Browse the repository at this point in the history
[ upstream commit 5ed2a2d4fdb696727b614f881f263851fad8832c ]

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: e489007 ("ethdev: add generic create/destroy ethdev APIs")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
  • Loading branch information
bruce-richardson authored and cpaelzer committed Mar 9, 2022
1 parent cf53c73 commit 322dd30
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/librte_ethdev/rte_ethdev_pci.h
Expand Up @@ -49,8 +49,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;
Expand Down

0 comments on commit 322dd30

Please sign in to comment.