Re: [PATCH] lib/test_rhashtable: Remove set but unused variable 'insert_retries'
From: Herbert Xu
Date: Wed Nov 23 2022 - 03:20:40 EST
On Wed, Nov 23, 2022 at 11:59:51AM +0800, Jiapeng Chong wrote:
>
> @@ -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)
This is wrong as you will now abort on a retried insertion. You
should instead test for err < 0.
Thanks,
--
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt