From b347adf962e14bcc711d7dfa818007c68b00cd49 Mon Sep 17 00:00:00 2001 From: Bruce Liu <2103458176@qq.com> Date: Wed, 8 Jul 2015 23:15:47 +0800 Subject: [PATCH 1/1] hash: fix build on non-x86 arch In the no-x86 branch, a parentheses is missing. And need to include header to use CHAR_BIT. Fixes: 49361c3f3cfa ("hash: remove duplicated code") Signed-off-by: Bruce Liu <2103458176@qq.com> Acked-by: Bruce Richardson --- 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 e230449a93..f9a8266cf6 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) { -- 2.20.1