All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ariel Otilibili-Anieli" <otilibil@eurecom.fr>
To: "Stephen Hemminger" <stephen@networkplumber.org>
Cc: dev@dpdk.org, "Thomas Monjalon" <thomas@monjalon.net>,
	"David Marchand" <david.marchand@redhat.com>,
	"Cristian Dumitrescu" <cristian.dumitrescu@intel.com>
Subject: Re: [PATCH 1/1] app/test: remove useless calls to rte_bitmap_free
Date: Fri, 13 Dec 2024 22:38:42 +0100	[thread overview]
Message-ID: <2f7a8b-675ca980-4faf-be99fc0@178539190> (raw)
In-Reply-To: <20241213085928.0f2f2de1@hermes.local>

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


  reply	other threads:[~2024-12-13 21:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2024-12-13 11:38 ` [v2 0/1] " Ariel Otilibili
2024-12-13 11:38   ` [v2 1/1] " Ariel Otilibili

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2f7a8b-675ca980-4faf-be99fc0@178539190 \
    --to=otilibil@eurecom.fr \
    --cc=cristian.dumitrescu@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=stephen@networkplumber.org \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.