DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] [PATCH v2] librte_hash: miss parentheses in hash function
@ 2015-07-08 15:15 damu
  2015-07-08 15:28 ` Bruce Richardson
  0 siblings, 1 reply; 3+ messages in thread
From: damu @ 2015-07-08 15:15 UTC (permalink / raw)
  To: dev

In the no-x86 branch, a parentheses is missing.
And need to include <limits.h> 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(-)

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] [PATCH v2] librte_hash: miss parentheses in hash function
  2015-07-08 15:15 [dpdk-dev] [PATCH] [PATCH v2] librte_hash: miss parentheses in hash function damu
@ 2015-07-08 15:28 ` Bruce Richardson
  2015-07-09  1:17   ` Thomas Monjalon
  0 siblings, 1 reply; 3+ messages in thread
From: Bruce Richardson @ 2015-07-08 15:28 UTC (permalink / raw)
  To: damu; +Cc: dev

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 <limits.h> 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 <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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] [PATCH v2] librte_hash: miss parentheses in hash function
  2015-07-08 15:28 ` Bruce Richardson
@ 2015-07-09  1:17   ` Thomas Monjalon
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2015-07-09  1:17 UTC (permalink / raw)
  To: damu; +Cc: dev

2015-07-08 16:28, Bruce Richardson:
> 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 <limits.h> 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. :-)

Applied, thanks

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-07-09  1:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-08 15:15 [dpdk-dev] [PATCH] [PATCH v2] librte_hash: miss parentheses in hash function damu
2015-07-08 15:28 ` Bruce Richardson
2015-07-09  1:17   ` Thomas Monjalon

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).