From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 4064CE72 for ; Wed, 8 Jul 2015 17:28:11 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP; 08 Jul 2015 08:28:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,432,1432623600"; d="scan'208";a="602404350" Received: from bricha3-mobl3.ger.corp.intel.com ([10.237.208.63]) by orsmga003.jf.intel.com with SMTP; 08 Jul 2015 08:28:09 -0700 Received: by (sSMTP sendmail emulation); Wed, 08 Jul 2015 16:28:07 +0025 Date: Wed, 8 Jul 2015 16:28:07 +0100 From: Bruce Richardson To: damu <2103458176@qq.com> Message-ID: <20150708152807.GA10344@bricha3-MOBL3> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Shannon Ltd. User-Agent: Mutt/1.5.23 (2014-03-12) Cc: dev Subject: Re: [dpdk-dev] [PATCH] [PATCH v2] librte_hash: miss parentheses in hash function 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, 08 Jul 2015 15:28:11 -0000 On Wed, Jul 08, 2015 at 11:15:47PM +0800, damu wrote: > In the no-x86 branch, a parentheses is missing. > And need to include header to use CHAR_BIT. > > Signed-off-by: Bruce Liu <2103458176@qq.com> Previously also reported here: http://dpdk.org/dev/patchwork/patch/6105/ Fixes line can be extracted for there, as can my ack, since it's an idential fix. :-) > --- > lib/librte_hash/rte_jhash.h | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/lib/librte_hash/rte_jhash.h b/lib/librte_hash/rte_jhash.h > index e230449..f9a8266 100644 > --- a/lib/librte_hash/rte_jhash.h > +++ b/lib/librte_hash/rte_jhash.h > @@ -46,6 +46,7 @@ extern "C" { > > #include > #include > +#include > > #include > #include > @@ -122,7 +123,7 @@ __rte_jhash_2hashes(const void *key, uint32_t length, uint32_t *pc, > const uint32_t *k = key; > const uint32_t s = 0; > #else > - const uint32_t *k = (uint32_t *)(uintptr_t)key & (uintptr_t)~3); > + const uint32_t *k = (uint32_t *)((uintptr_t)key & (uintptr_t)~3); > const uint32_t s = ((uintptr_t)key & 3) * CHAR_BIT; > #endif > if (!check_align || s == 0) { > -- > 1.8.3.1