From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH] rte_reciprocal: make arg to rte_reciprocal_divide_u64 const Date: Tue, 2 Apr 2019 08:26:19 -0700 Message-ID: <20190402082619.4ea83500@shemminger-XPS-13-9360> References: <20190321195910.11140-1-stephen@networkplumber.org> <4147107.f6clCcuQYr@xps> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org, maxime.coquelin@redhat.com To: Thomas Monjalon Return-path: Received: from mail-pg1-f196.google.com (mail-pg1-f196.google.com [209.85.215.196]) by dpdk.org (Postfix) with ESMTP id 9CEB2316B for ; Tue, 2 Apr 2019 17:26:22 +0200 (CEST) Received: by mail-pg1-f196.google.com with SMTP id p6so6732831pgh.9 for ; Tue, 02 Apr 2019 08:26:22 -0700 (PDT) In-Reply-To: <4147107.f6clCcuQYr@xps> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Wed, 27 Mar 2019 12:14:44 +0100 Thomas Monjalon 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 > > --- > > 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.