[RFC v3 08/26] dev: move unrelated macros from header
Thomas Monjalon
thomas at monjalon.net
Wed Aug 24 09:39:18 CEST 2022
24/08/2022 08:50, David Marchand:
> On Fri, Jul 29, 2022 at 3:22 PM David Marchand
> <david.marchand at redhat.com> wrote:
> >
> > On Fri, Jul 29, 2022 at 11:59 AM Bruce Richardson
> > <bruce.richardson at intel.com> wrote:
> > > > > Personally, I really don't like these macros at all. I think having the
> > > > > check explicitly in the code would be far more readable, and would only be
> > > > > one line of code longer than the macro call. Is there some private header
> > > > > file we could move these to instead of rte_common.h so we can drop their
> > > > > use in future if we decide to?
> > > >
> > > > I don't like them either.
> > > > Not sure where to put them though...
> > > >
> > > > My "grep-all" shows no user in the projects consuming DPDK I track.
> > > > We could mark those macros deprecated, fix our code and drop them later.
> > > >
> > > +1 to that.
> > > Can they be marked as deprecated as part of the move perhaps (assuming we
> > > get agreement to kill them?)
>
> Let's see if techboard members have an opinion.
These macros have no added value for an external user.
I think it is OK to mark them deprecated and plan for a future removal.
Copy of the code for the context:
/** Macros to check for invalid function pointers. */
#define RTE_FUNC_PTR_OR_ERR_RET(func, retval) do { \
if ((func) == NULL) \
return retval; \
} while (0)
#define RTE_FUNC_PTR_OR_RET(func) do { \
if ((func) == NULL) \
return; \
} while (0)
More information about the dev
mailing list