* [PATCH v2] lib/test_rhashtable: Remove set but unused variable 'insert_retries'
@ 2022-11-23 9:37 Jiapeng Chong
2022-11-24 9:25 ` Herbert Xu
2022-11-25 8:20 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Jiapeng Chong @ 2022-11-23 9:37 UTC (permalink / raw)
To: tgraf; +Cc: herbert, netdev, linux-kernel, Jiapeng Chong, Abaci Robot
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>
---
Changes in v2:
-The condition for modifying err is less than 0.
lib/test_rhashtable.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/lib/test_rhashtable.c b/lib/test_rhashtable.c
index 6a8e445c8b55..c20f6cb4bf55 100644
--- a/lib/test_rhashtable.c
+++ b/lib/test_rhashtable.c
@@ -434,7 +434,7 @@ static int __init test_rhltable(unsigned int entries)
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;
}
--
2.20.1.7.g153144c
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] lib/test_rhashtable: Remove set but unused variable 'insert_retries'
2022-11-23 9:37 [PATCH v2] lib/test_rhashtable: Remove set but unused variable 'insert_retries' Jiapeng Chong
@ 2022-11-24 9:25 ` Herbert Xu
2022-11-25 8:20 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Herbert Xu @ 2022-11-24 9:25 UTC (permalink / raw)
To: Jiapeng Chong; +Cc: tgraf, netdev, linux-kernel, Abaci Robot
On Wed, Nov 23, 2022 at 05:37:02PM +0800, Jiapeng Chong wrote:
> 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>
> ---
> Changes in v2:
> -The condition for modifying err is less than 0.
>
> lib/test_rhashtable.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Thanks,
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] lib/test_rhashtable: Remove set but unused variable 'insert_retries'
2022-11-23 9:37 [PATCH v2] lib/test_rhashtable: Remove set but unused variable 'insert_retries' Jiapeng Chong
2022-11-24 9:25 ` Herbert Xu
@ 2022-11-25 8:20 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-11-25 8:20 UTC (permalink / raw)
To: Jiapeng Chong; +Cc: tgraf, herbert, netdev, linux-kernel, abaci
Hello:
This patch was applied to netdev/net-next.git (master)
by David S. Miller <davem@davemloft.net>:
On Wed, 23 Nov 2022 17:37:02 +0800 you wrote:
> 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>
>
> [...]
Here is the summary with links:
- [v2] lib/test_rhashtable: Remove set but unused variable 'insert_retries'
https://git.kernel.org/netdev/net-next/c/b084f6cc3563
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-11-25 8:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-23 9:37 [PATCH v2] lib/test_rhashtable: Remove set but unused variable 'insert_retries' Jiapeng Chong
2022-11-24 9:25 ` Herbert Xu
2022-11-25 8:20 ` patchwork-bot+netdevbpf
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).