All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] lib/librte_table: fix copy paste error in lru hash table
@ 2017-10-27 10:47 Jasvinder Singh
  2017-11-07  1:01 ` Thomas Monjalon
  0 siblings, 1 reply; 2+ messages in thread
From: Jasvinder Singh @ 2017-10-27 10:47 UTC (permalink / raw)
  To: dev; +Cc: cristian.dumitrescu, john.mcnamara

Fixes the copy paste error in lru hash table parameters check.

Coverity issue: 198433
Fixes: b5cde2cb8c81 ("table: rework variable size key lru hash table")

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
---
 lib/librte_table/rte_table_hash_lru.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/lib/librte_table/rte_table_hash_lru.c b/lib/librte_table/rte_table_hash_lru.c
index 139b8fb..a07392f 100644
--- a/lib/librte_table/rte_table_hash_lru.c
+++ b/lib/librte_table/rte_table_hash_lru.c
@@ -148,15 +148,14 @@ check_params_create(struct rte_table_hash_params *params)
 	}
 
 	/* n_keys */
-	if ((params->n_keys == 0) ||
-		(!rte_is_power_of_2(params->n_keys))) {
+	if (params->n_keys == 0) {
 		RTE_LOG(ERR, TABLE, "%s: n_keys invalid value\n", __func__);
 		return -EINVAL;
 	}
 
 	/* n_buckets */
 	if ((params->n_buckets == 0) ||
-		(!rte_is_power_of_2(params->n_keys))) {
+		(!rte_is_power_of_2(params->n_buckets))) {
 		RTE_LOG(ERR, TABLE, "%s: n_buckets invalid value\n", __func__);
 		return -EINVAL;
 	}
-- 
2.9.3

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

* Re: [PATCH] lib/librte_table: fix copy paste error in lru hash table
  2017-10-27 10:47 [PATCH] lib/librte_table: fix copy paste error in lru hash table Jasvinder Singh
@ 2017-11-07  1:01 ` Thomas Monjalon
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Monjalon @ 2017-11-07  1:01 UTC (permalink / raw)
  To: Jasvinder Singh; +Cc: dev, cristian.dumitrescu, john.mcnamara

27/10/2017 12:47, Jasvinder Singh:
> Fixes the copy paste error in lru hash table parameters check.
> 
> Coverity issue: 198433
> Fixes: b5cde2cb8c81 ("table: rework variable size key lru hash table")
> 
> Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
> Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>

Applied with title "table: fix LRU hash table parameters check"

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

end of thread, other threads:[~2017-11-07  1:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-27 10:47 [PATCH] lib/librte_table: fix copy paste error in lru hash table Jasvinder Singh
2017-11-07  1:01 ` Thomas Monjalon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.