bitmap: change return value of rte_bitmap_free
PATCH 1/1 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.
--- doc/guides/rel_notes/release_25_11.rst | 3 +++ lib/eal/include/rte_bitmap.h | 14 +++----------- 2 files changed, 6 insertions(+), 11 deletions(-)
doc/guides/rel_notes/release_25_11.rst +3 -0
@@ -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 -----------
lib/eal/include/rte_bitmap.h +3 -11
@@ -280,22 +280,14 @@ rte_bitmap_init_with_all_set(uint32_t n_bits, uint8_t *mem, uint32_t mem_size) }/** -* Bitmap free +* Bitmap free does nothing in current version. * * @param bmp * Handle to bitmap instance -* @return -* 0 upon success, error code otherwise */ -static inline int -rte_bitmap_free (struct rte_bitmap *bmp) +static inline void +rte_bitmap_free(struct rte_bitmap *bmp __rte_unused) { -/* Check input arguments */ -if (bmp ==NULL ) { -return -1 ; - } - -return 0 ; }/**
Signature · 1 line
2.51.0
Quoted 11 lines
From: Stephen Hemminger [mailto:[email protected]]
Sent: Tuesday, 28 October 2025 21.45No existing code is checking the return value of
rte_bitmap_freeand other functions likerte_freedo 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]>
Thank you for cleaning up this.
With or without suggestion inline below,
Quoted 3 lines
/**
- * Bitmap free
+ * Bitmap free does nothing in current version.
Consider keeping the original headline and adding a note that it does nothing in current version instead.
Quoted 18 lines
*
* @param bmp
* Handle to bitmap instance
- * @return
- * 0 upon success, error code otherwise
*/lib/eal/include/rte_bitmap.h +2
-8-static inline int -rte_bitmap_free (struct rte_bitmap *bmp) +static inline void +rte_bitmap_free(struct rte_bitmap *bmp __rte_unused) { -/* Check input arguments */ -if (bmp ==NULL ) { -return -1 ; - } - -return 0 ; }
PATCH v2 1/1 bitmap: change return value of rte_bitmap_free
In reply to Stephen HemmingerNo 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.
--- doc/guides/rel_notes/release_25_11.rst | 3 +++ lib/eal/include/rte_bitmap.h | 13 ++++--------- 2 files changed, 7 insertions(+), 9 deletions(-)
doc/guides/rel_notes/release_25_11.rst +3 -0
@@ -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 -----------
lib/eal/include/rte_bitmap.h +4 -9
@@ -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); }/**
Signature · 1 line
2.51.0
Quoted 69 lines
-----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 ofrte_bitmap_freeNo existing code is checking the return value of
rte_bitmap_freeand other functions likerte_freedo 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(-)doc/guides/rel_notes/release_25_11.rst +3
-0@@ -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 -----------lib/eal/include/rte_bitmap.h +4
-9@@ -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); }
Quoted 2 lines
/**
--
Quoted 1 line
2.51.0
Thomas Monjalon
AppliedQuoted 10 lines
Quoted 9 lines
No existing code is checking the return value of
rte_bitmap_freeand other functions likerte_freedo 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]>
Applied, thanks.