DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] bitmap: change return value of rte_bitmap_free
@ 2025-10-28 20:44 Stephen Hemminger
  2025-10-29  0:15 ` Morten Brørup
  2025-10-29 14:50 ` [PATCH v2] " Stephen Hemminger
  0 siblings, 2 replies; 3+ messages in thread
From: Stephen Hemminger @ 2025-10-28 20:44 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Cristian Dumitrescu, Tyler Retzlaff

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 <stephen@networkplumber.org>
---
 doc/guides/rel_notes/release_25_11.rst |  3 +++
 lib/eal/include/rte_bitmap.h           | 14 +++-----------
 2 files changed, 6 insertions(+), 11 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..5a4a68cc2d 100644
--- a/lib/eal/include/rte_bitmap.h
+++ b/lib/eal/include/rte_bitmap.h
@@ -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;
 }
 
 /**
-- 
2.51.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH] bitmap: change return value of rte_bitmap_free
  2025-10-28 20:44 [PATCH] bitmap: change return value of rte_bitmap_free Stephen Hemminger
@ 2025-10-29  0:15 ` Morten Brørup
  2025-10-29 14:50 ` [PATCH v2] " Stephen Hemminger
  1 sibling, 0 replies; 3+ messages in thread
From: Morten Brørup @ 2025-10-29  0:15 UTC (permalink / raw)
  To: Stephen Hemminger, dev; +Cc: Cristian Dumitrescu, Tyler Retzlaff

> From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> Sent: Tuesday, 28 October 2025 21.45
> 
> 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 <stephen@networkplumber.org>

Thank you for cleaning up this.

With or without suggestion inline below,
Reviewed-by: Morten Brørup <mb@smartsharesystems.com>

>  /**
> - * 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.

>   *
>   * @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;
>  }


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH v2] bitmap: change return value of rte_bitmap_free
  2025-10-28 20:44 [PATCH] bitmap: change return value of rte_bitmap_free Stephen Hemminger
  2025-10-29  0:15 ` Morten Brørup
@ 2025-10-29 14:50 ` Stephen Hemminger
  1 sibling, 0 replies; 3+ messages in thread
From: Stephen Hemminger @ 2025-10-29 14:50 UTC (permalink / raw)
  To: dev
  Cc: Stephen Hemminger, Morten Brørup, Cristian Dumitrescu,
	Tyler Retzlaff

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 <stephen@networkplumber.org>
Reviewed-by: Morten Brørup <mb@smartsharesystems.com>
---
 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);
 }
 
 /**
-- 
2.51.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-10-29 14:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-10-28 20:44 [PATCH] bitmap: change return value of rte_bitmap_free Stephen Hemminger
2025-10-29  0:15 ` Morten Brørup
2025-10-29 14:50 ` [PATCH v2] " Stephen Hemminger

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).