From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1AE6645E94; Fri, 13 Dec 2024 22:38:44 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B00624068E; Fri, 13 Dec 2024 22:38:43 +0100 (CET) Received: from smtp.eurecom.fr (smtp.eurecom.fr [193.55.113.210]) by mails.dpdk.org (Postfix) with ESMTP id 9A614400D5 for ; Fri, 13 Dec 2024 22:38:42 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=eurecom.fr; i=@eurecom.fr; q=dns/txt; s=default; t=1734125922; x=1765661922; h=from:in-reply-to:references:date:cc:to:mime-version: message-id:subject:content-transfer-encoding; bh=7ZxoEh350POQgDvmgRi39uqiYIEx0MjNn5GxElzg/0o=; b=R2FJiARXbmLcA0TkBtLXbwuViaRhOT4UauCuChnv8vF3RUBLkvroI449 IuJouWyQE3QLsTSOKFyAjtYbolTaDpXyJ8IwHI4LklUpj5LCRZfXdvmoi IYdW4krrM+PAaSeRekVG9IC+dUgv78ywSL3+3k9eokOu5YxuH/MSrH9GX 0=; X-CSE-ConnectionGUID: RBZURCMUSl2IAAarRFHN3A== X-CSE-MsgGUID: WtdUgg6jRiK4ZzQI9nwwMQ== X-IronPort-AV: E=Sophos;i="6.12,232,1728943200"; d="scan'208";a="28178861" Received: from quovadis.eurecom.fr ([10.3.2.233]) by drago1i.eurecom.fr with ESMTP; 13 Dec 2024 22:38:42 +0100 From: "Ariel Otilibili-Anieli" In-Reply-To: <20241213085928.0f2f2de1@hermes.local> Content-Type: text/plain; charset="utf-8" X-Forward: 88.183.119.157 References: <20241213113059.59320-1-otilibil@eurecom.fr> <20241213113059.59320-2-otilibil@eurecom.fr> <20241213085928.0f2f2de1@hermes.local> Date: Fri, 13 Dec 2024 22:38:42 +0100 Cc: dev@dpdk.org, "Thomas Monjalon" , "David Marchand" , "Cristian Dumitrescu" To: "Stephen Hemminger" MIME-Version: 1.0 Message-ID: <2f7a8b-675ca980-4faf-be99fc0@178539190> Subject: =?utf-8?q?Re=3A?= [PATCH 1/1] =?utf-8?q?app/test=3A?= remove useless calls to =?utf-8?q?rte=5Fbitmap=5Ffree?= User-Agent: SOGoMail 5.11.1 Content-Transfer-Encoding: quoted-printable X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Friday, December 13, 2024 17:59 CET, Stephen Hemminger wrote: > On Fri, 13 Dec 2024 12:30:00 +0100 > Ariel Otilibili wrote: >=20 > > * rte=5Fbitmap=5Ffree is only useful for its return value > > * and its return value is not used. > >=20 > > ``` > > $ < lib/eal/include/rte=5Fbitmap.h sed -ne '/bitmap=5Ffree/,/^}/p' > >=20 > > rte=5Fbitmap=5Ffree(struct rte=5Fbitmap *bmp) > > { > > /* Check input arguments */ > > if (bmp =3D=3D NULL) { > > return -1; > > } > >=20 > > return 0; > > } > > ``` > >=20 > > Reported-by: Coverity, IDs 357712 & 357737 > > Signed-off-by: Ariel Otilibili > > --- > > app/test/test=5Fbitmap.c | 2 -- > > 1 file changed, 2 deletions(-) > >=20 > > diff --git a/app/test/test=5Fbitmap.c b/app/test/test=5Fbitmap.c > > index bab11812c7..a21210a215 100644 > > --- a/app/test/test=5Fbitmap.c > > +++ b/app/test/test=5Fbitmap.c > > @@ -208,7 +208,6 @@ test=5Fbitmap=5Fall=5Fclear(void) > > if (test=5Fbitmap=5Fscan=5Foperations(bmp) < 0) > > return TEST=5FFAILED; > > =20 > > - rte=5Fbitmap=5Ffree(bmp); > > rte=5Ffree(mem); > > =20 > > return TEST=5FSUCCESS; > > @@ -254,7 +253,6 @@ test=5Fbitmap=5Fall=5Fset(void) > > return TEST=5FFAILED; > > } > > =20 > > - rte=5Fbitmap=5Ffree(bmp); > > rte=5Ffree(mem); > > =20 > > return TEST=5FSUCCESS; >=20 > I would rather that, rte=5Fbitmap=5Ffree() be made a real function > which would shutup Coverity. >=20 > And rte=5Fbitmap=5Ffree() should just be a void function, like all th= e > other XXX=5Ffree() variants in DPDK. I will work on a Version 3 of this series, Stephen; your feedback lande= d into Version 1. For my understanding, on which of the XXX=5Ffree should I model a rte=5F= bitmap=5Ffree returning void? Here are the occurrences of rte=5Fbitmap=5Ffree() ``` $ git grep -Pn 'rte=5Fbitmap=5Ffree\(' app/test/test=5Fbitmap.c:211: rte=5Fbitmap=5Ffree(bmp); app/test/test=5Fbitmap.c:257: rte=5Fbitmap=5Ffree(bmp); devtools/cocci/nullfree.cocci:19:- if (E !=3D NULL) rte=5Fbitmap=5Ffree= (E); devtools/cocci/nullfree.cocci:20:+ rte=5Fbitmap=5Ffree(E); drivers/common/mlx5/mlx5=5Fcommon=5Fmr.c:497: rte=5Fbitmap=5Ffree= (mr->ms=5Fbmp); drivers/crypto/ionic/ionic=5Fcrypto=5Fmain.c:817: rte=5Fbitma= p=5Ffree(dev->sess=5Fbm); drivers/net/bonding/rte=5Feth=5Fbond=5Fpmd.c:2246: rte=5Fbitmap=5Ffr= ee(internals->vlan=5Ffilter=5Fbmp); drivers/net/cxgbe/cxgbe=5Fmain.c:468: rte=5Fbitmap=5Ffree(t= ->ftid=5Fbmap); drivers/net/mlx4/mlx4=5Fmr.c:474: rte=5Fbitmap=5Ffree(mr->ms=5Fbmp); drivers/net/netvsc/hn=5Frxtx.c:186: rte=5Fbitmap=5Ffree(hv->chim=5F= bmap); drivers/net/sfc/sfc=5Fsw=5Fstats.c:818: rte=5Fbitmap=5Ffree(sa->sw=5F= stats.queues=5Fbitmap); lib/eal/include/rte=5Fbitmap.h:291:rte=5Fbitmap=5Ffree(struct rte=5Fbit= map *bmp) ```