From patchwork Wed Jul 8 15:15:47 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Liu <2103458176@qq.com> X-Patchwork-Id: 6198 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 4964D5A58; Wed, 8 Jul 2015 17:16:17 +0200 (CEST) Received: from smtpbguseast2.qq.com (smtpbguseast2.qq.com [54.204.34.130]) by dpdk.org (Postfix) with ESMTP id 7F6555A3E for ; Wed, 8 Jul 2015 17:16:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201307; t=1436368548; bh=NoDd5S5YvPHk7PVzA1bOB20T3uGqIyB1Hc8u6bFmcsw=; h=From:To:Cc:Subject:Mime-Version:Content-Type:Content-Transfer-Encoding:Date:Message-ID; b=mAQPS/MoUwud/K6UOGAOscGsSiOLdLlIL1hB4lFZJJPDRHCHZi4Efsso5yXKUZuwp 2+sSpIWGNYonIdKfgAMixPfKy3D6at1wNuq1lI2MXAnxFVIs/G11ghl5IMo2zk5uQt U0hp84pKiPbgT3Wes2gb3RHln1R3qPxt+C07Z0ro= X-QQ-FEAT: wXMbxCcERP0wwZysEyoiOQYJGTuJ0zGzQcCQx9SNm6hgQko4zd0IBpI01Tg/W s011MDhXq5W106QVf+/E3Q1tzVhVFEv2YQRuMjy6Rt0LkK+eN0g2Rd5GfQfErLud2mbOtke DkH6mQXHjrZS1+1zVRMSMYIFURlfkJn+p8YBdT4fnNZthUORsiPJdLYLYRfKm6orWMutbou E9/nBv4SH9emc9+pCOUyE X-QQ-SSF: 0000000000000030000000000000001 X-HAS-ATTACH: no X-QQ-BUSINESS-ORIGIN: 2 X-Originating-IP: 112.65.107.220 X-QQ-STYLE: X-QQ-mid: webmail836t1436368547t8612144 From: "=?ISO-8859-1?B?ZGFtdQ==?=" <2103458176@qq.com> To: "=?ISO-8859-1?B?ZGV2?=" Mime-Version: 1.0 Date: Wed, 8 Jul 2015 23:15:47 +0800 X-Priority: 3 Message-ID: X-QQ-MIME: TCMime 1.0 by Tencent X-Mailer: QQMail 2.x X-QQ-Mailer: QQMail 2.x X-QQ-SENDSIZE: 520 X-QQ-Bgrelay: 1 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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> --- lib/librte_hash/rte_jhash.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 1.8.3.1 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) {