summaryrefslogtreecommitdiff
path: root/lib/test_rhashtable.c
diff options
context:
space:
mode:
authorJiapeng Chong <jiapeng.chong@linux.alibaba.com>2022-11-23 17:37:02 +0800
committerDavid S. Miller <davem@davemloft.net>2022-11-25 08:09:12 +0000
commitb084f6cc3563faf4f4d16c98852c0c734fe18914 (patch)
treed141af3905a55cc8b30457b607ae262d8c81e605 /lib/test_rhashtable.c
parentf72cd76b05ea1ce9258484e8127932d0ea928f22 (diff)
lib/test_rhashtable: Remove set but unused variable 'insert_retries'
Variable 'insert_retries' is not effectively used in the function, so delete it. lib/test_rhashtable.c:437:18: warning: variable 'insert_retries' set but not used. Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3242 Reported-by: Abaci Robot <abaci@linux.alibaba.com> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com> Acked-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'lib/test_rhashtable.c')
-rw-r--r--lib/test_rhashtable.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/test_rhashtable.c b/lib/test_rhashtable.c
index f2ba5787055a..3ae3399f3651 100644
--- a/lib/test_rhashtable.c
+++ b/lib/test_rhashtable.c
@@ -434,7 +434,7 @@ out_free:
static int __init test_rhashtable_max(struct test_obj *array,
unsigned int entries)
{
- unsigned int i, insert_retries = 0;
+ unsigned int i;
int err;
test_rht_params.max_size = roundup_pow_of_two(entries / 8);
@@ -447,9 +447,7 @@ static int __init test_rhashtable_max(struct test_obj *array,
obj->value.id = i * 2;
err = insert_retry(&ht, obj, test_rht_params);
- if (err > 0)
- insert_retries += err;
- else if (err)
+ if (err < 0)
return err;
}