librte_hash: miss parentheses in hash function
PATCH v2 1/1 librte_hash: miss parentheses in hash function
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 <[email protected]>
--- lib/librte_hash/rte_jhash.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
lib/librte_hash/rte_jhash.h +2 -1
@@ -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 ) {
Signature · 1 line
1.8.3.1
Quoted 4 lines · damu
In the no-x86 branch, a parentheses is missing. And need to include <
limits.h> header to useCHAR_BIT.Signed-off-by Bruce Liu <[email protected]>
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. :-)
Quoted 27 lines
--- lib/librte_hash/rte_jhash.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)lib/librte_hash/rte_jhash.h +2
-1@@ -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 ) {Signature · 1 line
1.8.3.1
Thomas Monjalon
Applied2015-07-08 16:28, Bruce Richardson:
Quoted 8 lines · damu
Quoted 4 lines
In the no-x86 branch, a parentheses is missing. And need to include <
limits.h> header to useCHAR_BIT.Signed-off-by Bruce Liu <[email protected]>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