From: Bruce Liu <2103458176@qq.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH] [PATCH] librte_hash: miss parentheses in hash function
Date: Wed, 8 Jul 2015 17:26:34 -0400 [thread overview]
Message-ID: <1436390794-22008-1-git-send-email-2103458176@qq.com> (raw)
In the no-x86 branch, a parentheses is missing.
And need to include <limits.h> 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 <stdint.h>
#include <string.h>
+#include <limits.h>
#include <rte_log.h>
#include <rte_byteorder.h>
@@ -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
next reply other threads:[~2015-07-08 14:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-08 21:26 Bruce Liu [this message]
2015-07-08 15:01 ` Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1436390794-22008-1-git-send-email-2103458176@qq.com \
--to=2103458176@qq.com \
--cc=dev@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).