* [PATCH 0/1] app/test: remove useless calls to rte_bitmap_free
@ 2024-12-13 11:29 Ariel Otilibili
2024-12-13 11:30 ` [PATCH 1/1] " Ariel Otilibili
2024-12-13 11:38 ` [v2 0/1] " Ariel Otilibili
0 siblings, 2 replies; 6+ messages in thread
From: Ariel Otilibili @ 2024-12-13 11:29 UTC (permalink / raw)
To: dev; +Cc: Thomas Monjalon, David Marchand, Cristian Dumitrescu, Ariel Otilibili
Hello,
This patch fixes the Coverity IDs 357712 & 357737.
Afterwards the application compiles without warnings.
Thank you,
Ariel Otilibili (1):
app/test: remove useless calls to rte_bitmap_free
app/test/test_bitmap.c | 2 --
1 file changed, 2 deletions(-)
--
2.47.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/1] app/test: remove useless calls to rte_bitmap_free
2024-12-13 11:29 [PATCH 0/1] app/test: remove useless calls to rte_bitmap_free Ariel Otilibili
@ 2024-12-13 11:30 ` Ariel Otilibili
2024-12-13 16:59 ` Stephen Hemminger
2024-12-13 11:38 ` [v2 0/1] " Ariel Otilibili
1 sibling, 1 reply; 6+ messages in thread
From: Ariel Otilibili @ 2024-12-13 11:30 UTC (permalink / raw)
To: dev; +Cc: Thomas Monjalon, David Marchand, Cristian Dumitrescu, Ariel Otilibili
* 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@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;
--
2.47.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [v2 0/1] app/test: remove useless calls to rte_bitmap_free
2024-12-13 11:29 [PATCH 0/1] app/test: remove useless calls to rte_bitmap_free Ariel Otilibili
2024-12-13 11:30 ` [PATCH 1/1] " Ariel Otilibili
@ 2024-12-13 11:38 ` Ariel Otilibili
2024-12-13 11:38 ` [v2 1/1] " Ariel Otilibili
1 sibling, 1 reply; 6+ messages in thread
From: Ariel Otilibili @ 2024-12-13 11:38 UTC (permalink / raw)
To: dev; +Cc: Thomas Monjalon, David Marchand, Cristian Dumitrescu, Ariel Otilibili
*** BLURB HERE ***
Ariel Otilibili (1):
app/test: remove useless calls to rte_bitmap_free
app/test/test_bitmap.c | 2 --
1 file changed, 2 deletions(-)
--
v2:
* fix style issues.
2.47.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [v2 1/1] app/test: remove useless calls to rte_bitmap_free
2024-12-13 11:38 ` [v2 0/1] " Ariel Otilibili
@ 2024-12-13 11:38 ` Ariel Otilibili
0 siblings, 0 replies; 6+ messages in thread
From: Ariel Otilibili @ 2024-12-13 11:38 UTC (permalink / raw)
To: dev; +Cc: Thomas Monjalon, David Marchand, Cristian Dumitrescu, Ariel Otilibili
* 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;
}
```
Coverity issue: 357712
Coverity issue: 357737
Signed-off-by: Ariel Otilibili <otilibil@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;
--
2.47.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/1] app/test: remove useless calls to rte_bitmap_free
2024-12-13 11:30 ` [PATCH 1/1] " Ariel Otilibili
@ 2024-12-13 16:59 ` Stephen Hemminger
2024-12-13 21:38 ` Ariel Otilibili-Anieli
0 siblings, 1 reply; 6+ messages in thread
From: Stephen Hemminger @ 2024-12-13 16:59 UTC (permalink / raw)
To: Ariel Otilibili; +Cc: dev, Thomas Monjalon, David Marchand, Cristian Dumitrescu
On Fri, 13 Dec 2024 12:30:00 +0100
Ariel Otilibili <otilibil@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@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.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/1] app/test: remove useless calls to rte_bitmap_free
2024-12-13 16:59 ` Stephen Hemminger
@ 2024-12-13 21:38 ` Ariel Otilibili-Anieli
0 siblings, 0 replies; 6+ messages in thread
From: Ariel Otilibili-Anieli @ 2024-12-13 21:38 UTC (permalink / raw)
To: Stephen Hemminger
Cc: dev, Thomas Monjalon, David Marchand, Cristian Dumitrescu
On Friday, December 13, 2024 17:59 CET, Stephen Hemminger <stephen@networkplumber.org> wrote:
> On Fri, 13 Dec 2024 12:30:00 +0100
> Ariel Otilibili <otilibil@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@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.
I will work on a Version 3 of this series, Stephen; your feedback landed into Version 1.
For my understanding, on which of the XXX_free should I model a rte_bitmap_free returning void?
Here are the occurrences of rte_bitmap_free()
```
$ git grep -Pn 'rte_bitmap_free\('
app/test/test_bitmap.c:211: rte_bitmap_free(bmp);
app/test/test_bitmap.c:257: rte_bitmap_free(bmp);
devtools/cocci/nullfree.cocci:19:- if (E != NULL) rte_bitmap_free(E);
devtools/cocci/nullfree.cocci:20:+ rte_bitmap_free(E);
drivers/common/mlx5/mlx5_common_mr.c:497: rte_bitmap_free(mr->ms_bmp);
drivers/crypto/ionic/ionic_crypto_main.c:817: rte_bitmap_free(dev->sess_bm);
drivers/net/bonding/rte_eth_bond_pmd.c:2246: rte_bitmap_free(internals->vlan_filter_bmp);
drivers/net/cxgbe/cxgbe_main.c:468: rte_bitmap_free(t->ftid_bmap);
drivers/net/mlx4/mlx4_mr.c:474: rte_bitmap_free(mr->ms_bmp);
drivers/net/netvsc/hn_rxtx.c:186: rte_bitmap_free(hv->chim_bmap);
drivers/net/sfc/sfc_sw_stats.c:818: rte_bitmap_free(sa->sw_stats.queues_bitmap);
lib/eal/include/rte_bitmap.h:291:rte_bitmap_free(struct rte_bitmap *bmp)
```
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-12-13 21:38 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-12-13 11:29 [PATCH 0/1] app/test: remove useless calls to rte_bitmap_free Ariel Otilibili
2024-12-13 11:30 ` [PATCH 1/1] " Ariel Otilibili
2024-12-13 16:59 ` Stephen Hemminger
2024-12-13 21:38 ` Ariel Otilibili-Anieli
2024-12-13 11:38 ` [v2 0/1] " Ariel Otilibili
2024-12-13 11:38 ` [v2 1/1] " Ariel Otilibili
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).