Hi Kevin,

If you only need access to this linked list for iterating through it, you can 
add a new function: struct link *link_next(struct link *) that gets you the 
next element in the list (for first element, invoke with link = NULL; at and of 
list, it returns NULL). Makes sense?

Are there other usages of this linked list that you need to cover?

Regards,
Cristian

> -----Original Message-----
> From: Laatz, Kevin
> Sent: Friday, June 15, 2018 3:57 PM
> To: Dumitrescu, Cristian <cristian.dumitre...@intel.com>; dev@dpdk.org
> Cc: Singh, Jasvinder <jasvinder.si...@intel.com>
> Subject: RE: [PATCH] examples/ip_pipeline: add link show to the cli
> 
> Hi Cristian,
> 
> > > +
> > > + link_list = links_get();
> >
> > We don't need this function, the lined list of links is a global public 
> > object,
> > please access it directly.
> 
> link_list is declared as a static struct in link.c so it is not accessible 
> from cli.c
> 
> I can either leave this function in to pass the pointer to the cli.c or move 
> the
> declaration to link.h.
> Do you have a preference?
> 
> > >
> > > +struct link_list *
> > > +links_get(void)
> > > +{
> > > + return &link_list;
> > > +}
> > > +
> >
> > Function to be removed, used linked list of links directly (see comment
> > above).
> 
> See above comment
> 
> Thanks,
> Kevin

Reply via email to