> -----Original Message-----
> From: Stephen Hemminger [mailto:step...@networkplumber.org]
> Sent: Friday, September 6, 2019 7:24 PM
> To: Zapolski, MarcinX A <marcinx.a.zapol...@intel.com>
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [RFC 19.11 v2 1/3] ethdev: hide key ethdev
> structures from public API
> 
> On Fri,  6 Sep 2019 15:18:11 +0200
> Marcin Zapolski <marcinx.a.zapol...@intel.com> wrote:
> 
> > +RTE_INIT(rte_eth_dev_init)
> > +{
> > +   int i;
> > +
> > +   for (i = 0; i < RTE_MAX_ETHPORTS; i++)
> > +           rte_eth_dev_functions[i] =
> > +                   (struct rte_eth_dev_fcns *)(&rte_eth_devices[i]);
> 
> Casts are error prone. Is it possible to use container_of instead of direct 
> cast.
I could if I had a pointer to struct rte_eth_dev_functions and needed to get 
struct rte_eth_dev which is a container structure in this case. But I could use 
offsetof instead.

Reply via email to