From mboxrd@z Thu Jan 1 00:00:00 1970 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) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP; 10 Jun 2015 04:09:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,587,1427785200"; d="scan'208";a="708506838" Received: from bricha3-mobl3.ger.corp.intel.com ([10.243.20.21]) by orsmga001.jf.intel.com with SMTP; 10 Jun 2015 04:09:46 -0700 Received: by (sSMTP sendmail emulation); Wed, 10 Jun 2015 12:09:45 +0025 Date: Wed, 10 Jun 2015 12:09:45 +0100 From: Bruce Richardson To: Pablo de Lara 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 Content-Disposition: inline In-Reply-To: <1432289771-12799-10-git-send-email-pablo.de.lara.guarch@intel.com> Organization: Intel Shannon Ltd. User-Agent: Mutt/1.5.23 (2014-03-12) Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v5 09/10] hash: rename rte_jhash2 to rte_jhash_32b X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Jun 2015 11:09:50 -0000 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