[dpdk-dev] [PATCH] rte_reciprocal: make arg to rte_reciprocal_divide_u64 const

Stephen Hemminger stephen at networkplumber.org
Tue Apr 2 17:26:19 CEST 2019


On Wed, 27 Mar 2019 12:14:44 +0100
Thomas Monjalon <thomas at monjalon.net> wrote:

> 21/03/2019 20:59, Stephen Hemminger:
> > The divisor is not modified here. Doesn't really matter for optimizaton
> > since the function is inline already; but helps with expressing
> > intent.
> > 
> > Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
> > ---
> >  static __rte_always_inline uint64_t
> > -rte_reciprocal_divide_u64(uint64_t a, struct rte_reciprocal_u64 *R)
> > +rte_reciprocal_divide_u64(uint64_t a, const struct rte_reciprocal_u64 *R)  
> 
> Why not doing the same change for rte_reciprocal_divide()?
It doesn't make sense for rte_reciprocal_divide since rte_reciprocal_divide
is call by value (ie doesn't take a pointer).


> Should we advertise such API change?

No. Since constant is always less intrusive than previous version
all cases will work the same.


More information about the dev mailing list