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

Tyler Retzlaff roretzla at linux.microsoft.com
Thu Jan 14 06:45:49 CET 2021


On Wed, Jan 13, 2021 at 08:52:55PM +0300, Dmitry Kozlyuk wrote:
> 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".

i'll submit a new rev that changes this, it's not really windows specific
but i guess windows is the only people crazy enough to use c++.

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

yep, will do thanks.

> 
> > 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)?

interesting, i'll look into why/how it is being included and confirm. i suppose
the question in the back of my mind is if it is private then why is the header
being installed at all?


More information about the dev mailing list