> -----Original Message-----
> From: Stephen Hemminger <[email protected]>
> Sent: Wednesday, October 29, 2025 2:51 PM
> To: [email protected]
> Cc: Stephen Hemminger <[email protected]>; Morten Brørup
> <[email protected]>; Cristian Dumitrescu
> <[email protected]>; Tyler Retzlaff <[email protected]>
> Subject: [PATCH v2] bitmap: change return value of rte_bitmap_free
> 
> No existing code is checking the return value of rte_bitmap_free
> and other functions like rte_free do not return an int.
> Change it to just a stub void function.
> 
> This was motivated by Coverity warnings about unchecked return
> value.
> 
> Signed-off-by: Stephen Hemminger <[email protected]>
> Reviewed-by: Morten Brørup <[email protected]>
> ---
>  doc/guides/rel_notes/release_25_11.rst |  3 +++
>  lib/eal/include/rte_bitmap.h           | 13 ++++---------
>  2 files changed, 7 insertions(+), 9 deletions(-)
> 
> diff --git a/doc/guides/rel_notes/release_25_11.rst
> b/doc/guides/rel_notes/release_25_11.rst
> index c5ba335cfc..4b8e084204 100644
> --- a/doc/guides/rel_notes/release_25_11.rst
> +++ b/doc/guides/rel_notes/release_25_11.rst
> @@ -220,6 +220,9 @@ API Changes
>    The link type was previously hardcoded to the Ethernet link type in the 
> API.
>    This argument is added to ``rte_pcapng_add_interface``.
> 
> +* bitmap: Changed the return type of ``rte_bitmap_free()`` to void
> +  for consistency with other free functions.
> +
> 
>  ABI Changes
>  -----------
> diff --git a/lib/eal/include/rte_bitmap.h b/lib/eal/include/rte_bitmap.h
> index abb102f1d3..ebe6c44998 100644
> --- a/lib/eal/include/rte_bitmap.h
> +++ b/lib/eal/include/rte_bitmap.h
> @@ -282,20 +282,15 @@ rte_bitmap_init_with_all_set(uint32_t n_bits, uint8_t
> *mem, uint32_t mem_size)
>  /**
>   * Bitmap free
>   *
> + * This function does nothing in current implementation.
> + *
>   * @param bmp
>   *   Handle to bitmap instance
> - * @return
> - *   0 upon success, error code otherwise
>   */
> -static inline int
> +static inline void
>  rte_bitmap_free(struct rte_bitmap *bmp)
>  {
> -     /* Check input arguments */
> -     if (bmp == NULL) {
> -             return -1;
> -     }
> -
> -     return 0;
> +     RTE_SET_USED(bmp);
>  }
> 
>  /**
> --
Acked-by: Konstantin Ananyev <[email protected]>
> 2.51.0

Reply via email to