[dpdk-stable] [PATCH] eal/headers: explicitly cast void * to type *

Dmitry Kozlyuk dmitry.kozliuk at gmail.com
Wed Jan 13 18:52:55 CET 2021


On Mon, 11 Jan 2021 17:18:45 -0800, Tyler Retzlaff wrote:
> Explicitly cast void * to type * so that eal headers may be compiled
> as C or C++.

Topic should probably be "eal/windows".

Fixes: e8428a9d89f1 ("eal/windows: add some basic functions and macros")
Cc: stable at dpdk.org

> Signed-off-by: Tyler Retzlaff <roretzla at linux.microsoft.com>
> ---
[...] 
> diff --git a/lib/librte_ethdev/rte_ethdev_pci.h b/lib/librte_ethdev/rte_ethdev_pci.h
> index bf715896a..c20be29b1 100644
> --- a/lib/librte_ethdev/rte_ethdev_pci.h
> +++ b/lib/librte_ethdev/rte_ethdev_pci.h
> @@ -47,7 +47,7 @@ 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;
> +	struct rte_pci_device *pci_dev = (struct rte_pci_device *)bus_device;
>  
>  	if (!pci_dev)
>  		return -ENODEV;

This is a private header, it's never exposed---why the change is needed (not
that I have a strong opinion, though)?


More information about the stable mailing list