From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <2103458176@qq.com> Received: from smtpbg329.qq.com (unknown [14.17.43.214]) by dpdk.org (Postfix) with ESMTP id 15930E72 for ; Wed, 8 Jul 2015 16:00:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201307; t=1436364025; bh=i5DScd22Cn2QLsGoBr87FgfagK2TmrcysoFd9iYsYBA=; h=From:To:Cc:Subject:Date:Message-Id; b=qhQkRtcJLgjsh8PDiIgvA+e+9Pqhk0v3dSVrcx+Vhw05sC6rMG/5T34BcG5lHLQZs B4BbR1pzVk+n7qboeCF9X0qmdBVMQIXI8FiI2GKj07+XfWHrFCo/lYlVwAC0qKJAtd tVLs2YYN9nlQ91l3QV/SxXMRLXgfklqAC6Sjbmcw= X-QQ-Spam: true X-QQ-mid: esmtp23t1436361996t346t32425 Received: from localhost (unknown [112.65.63.35]) by esmtp4.qq.com (ESMTP) with id ; Wed, 08 Jul 2015 21:26:35 +0800 (CST) X-QQ-SSF: A100000000000030711200000000001 From: Bruce Liu <2103458176@qq.com> To: dev@dpdk.org Date: Wed, 8 Jul 2015 17:26:34 -0400 Message-Id: <1436390794-22008-1-git-send-email-2103458176@qq.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dpdk-dev] [PATCH] [PATCH] 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 14:00:28 -0000 In the no-x86 branch, a parentheses is missing. And need to include header to use CHAR_BIT. --- 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