[PATCH 1/1] app/test: remove useless calls to rte_bitmap_free

Stephen Hemminger stephen at networkplumber.org
Fri Dec 13 17:59:28 CET 2024


On Fri, 13 Dec 2024 12:30:00 +0100
Ariel Otilibili <otilibil at eurecom.fr> wrote:

> * rte_bitmap_free is only useful for its return value
> * and its return value is not used.
> 
> ```
> $ < lib/eal/include/rte_bitmap.h sed -ne '/bitmap_free/,/^}/p'
> 
> rte_bitmap_free(struct rte_bitmap *bmp)
> {
>         /* Check input arguments */
>         if (bmp == NULL) {
>                 return -1;
>         }
> 
>         return 0;
> }
> ```
> 
> Reported-by: Coverity, IDs 357712 & 357737
> Signed-off-by: Ariel Otilibili <otilibil at eurecom.fr>
> ---
>  app/test/test_bitmap.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/app/test/test_bitmap.c b/app/test/test_bitmap.c
> index bab11812c7..a21210a215 100644
> --- a/app/test/test_bitmap.c
> +++ b/app/test/test_bitmap.c
> @@ -208,7 +208,6 @@ test_bitmap_all_clear(void)
>  	if (test_bitmap_scan_operations(bmp) < 0)
>  		return TEST_FAILED;
>  
> -	rte_bitmap_free(bmp);
>  	rte_free(mem);
>  
>  	return TEST_SUCCESS;
> @@ -254,7 +253,6 @@ test_bitmap_all_set(void)
>  		return TEST_FAILED;
>  	}
>  
> -	rte_bitmap_free(bmp);
>  	rte_free(mem);
>  
>  	return TEST_SUCCESS;

I would rather that, rte_bitmap_free() be made a real function
which would shutup Coverity.

And rte_bitmap_free() should just be a void function, like all the
other XXX_free() variants in DPDK.


More information about the dev mailing list