From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bruce Richardson Subject: Re: [PATCH v5 09/10] hash: rename rte_jhash2 to rte_jhash_32b Date: Wed, 10 Jun 2015 12:09:45 +0100 Message-ID: <20150610110945.GC6924@bricha3-MOBL3> References: <1431428560-25426-1-git-send-email-pablo.de.lara.guarch@intel.com> <1432289771-12799-1-git-send-email-pablo.de.lara.guarch@intel.com> <1432289771-12799-10-git-send-email-pablo.de.lara.guarch@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: dev@dpdk.org To: Pablo de Lara Return-path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 925815A9B for ; Wed, 10 Jun 2015 13:09:49 +0200 (CEST) Content-Disposition: inline In-Reply-To: <1432289771-12799-10-git-send-email-pablo.de.lara.guarch@intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Fri, May 22, 2015 at 11:16:10AM +0100, Pablo de Lara wrote: > Changed name to something more meaningful, > and mark rte_jhash2 as deprecated. > > Signed-off-by: Pablo de Lara > --- > app/test/test_func_reentrancy.c | 2 +- > app/test/test_hash.c | 4 ++-- > app/test/test_hash_functions.c | 6 +++--- > lib/librte_hash/rte_jhash.h | 17 +++++++++++++++-- > 4 files changed, 21 insertions(+), 8 deletions(-) > > @@ -278,7 +280,7 @@ rte_jhash_2hashes(const void *key, uint32_t length, uint32_t *pc, uint32_t *pb) > * IN: second seed OUT: secondary hash value. > */ > static inline void > -rte_jhash2_2hashes(const uint32_t *k, uint32_t length, uint32_t *pc, uint32_t *pb) > +rte_jhash_32b_2hashes(const uint32_t *k, uint32_t length, uint32_t *pc, uint32_t *pb) > { > __rte_jhash_2hashes((const void *) k, (length << 2), pc, pb, 0); > } > @@ -321,11 +323,22 @@ rte_jhash(const void *key, uint32_t length, uint32_t initval) > * Calculated hash value. > */ > static inline uint32_t > +rte_jhash_32b(const uint32_t *k, uint32_t length, uint32_t initval) > +{ > + uint32_t initval2 = 0; > + > + rte_jhash_32b_2hashes(k, length, &initval, &initval2); > + > + return initval; > +} > + > +static inline uint32_t > rte_jhash2(const uint32_t *k, uint32_t length, uint32_t initval) > { > uint32_t initval2 = 0; > > - rte_jhash2_2hashes(k, length, &initval, &initval2); > + RTE_LOG(WARNING, HASH, "rte_jhash2 is deprecated\n"); > + rte_jhash_32b_2hashes(k, length, &initval, &initval2); > > return initval; > } To deprecate this, rather than printing a message each time it is called, just add "__attribute__((deprecated))" to the definition, and let the compiler do the work of flagging this to the user. /Bruce