From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 381878D9F for ; Fri, 11 Sep 2015 19:28:19 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP; 11 Sep 2015 10:28:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,512,1437462000"; d="scan'208";a="802571243" Received: from irsmsx105.ger.corp.intel.com ([163.33.3.28]) by orsmga002.jf.intel.com with ESMTP; 11 Sep 2015 10:28:17 -0700 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.12]) by irsmsx105.ger.corp.intel.com ([169.254.7.51]) with mapi id 14.03.0224.002; Fri, 11 Sep 2015 18:28:15 +0100 From: "Dumitrescu, Cristian" To: Stephen Hemminger Thread-Topic: [PATCH 2/2] rte_sched: remove useless bitmap_free Thread-Index: AQHQ4bGWpwZthM5G20iXqBYdOm3PDZ43qZLQ Date: Fri, 11 Sep 2015 17:28:15 +0000 Message-ID: <3EB4FA525960D640B5BDFFD6A3D89126478BAA2E@IRSMSX108.ger.corp.intel.com> References: <1440780599-14851-1-git-send-email-stephen@networkplumber.org> <1440780599-14851-3-git-send-email-stephen@networkplumber.org> In-Reply-To: <1440780599-14851-3-git-send-email-stephen@networkplumber.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH 2/2] rte_sched: remove useless bitmap_free X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Sep 2015 17:28:19 -0000 > -----Original Message----- > From: Stephen Hemminger [mailto:stephen@networkplumber.org] > Sent: Friday, August 28, 2015 7:50 PM > To: Dumitrescu, Cristian > Cc: dev@dpdk.org; Stephen Hemminger > Subject: [PATCH 2/2] rte_sched: remove useless bitmap_free >=20 > Coverity reports that rte_bitmap_free() does nothing and caller does > not check return value. Just remove it. >=20 > Also since rte_free(NULL) is a nop, remove useless check here. >=20 > Signed-off-by: Stephen Hemminger > --- > lib/librte_sched/rte_bitmap.h | 19 ------------------- > lib/librte_sched/rte_sched.c | 5 ----- > 2 files changed, 24 deletions(-) >=20 > diff --git a/lib/librte_sched/rte_bitmap.h b/lib/librte_sched/rte_bitmap.= h > index 216a344..47eeeeb 100644 > --- a/lib/librte_sched/rte_bitmap.h > +++ b/lib/librte_sched/rte_bitmap.h > @@ -275,25 +275,6 @@ rte_bitmap_init(uint32_t n_bits, uint8_t *mem, > uint32_t mem_size) > } >=20 > /** > - * Bitmap free > - * > - * @param bmp > - * Handle to bitmap instance > - * @return > - * 0 upon success, error code otherwise > - */ > -static inline int > -rte_bitmap_free(struct rte_bitmap *bmp) > -{ > - /* Check input arguments */ > - if (bmp =3D=3D NULL) { > - return -1; > - } > - > - return 0; > -} > - > -/** > * Bitmap reset > * > * @param bmp > diff --git a/lib/librte_sched/rte_sched.c b/lib/librte_sched/rte_sched.c > index 924c172..cbe3f3b 100644 > --- a/lib/librte_sched/rte_sched.c > +++ b/lib/librte_sched/rte_sched.c > @@ -716,11 +716,6 @@ rte_sched_port_config(struct > rte_sched_port_params *params) > void > rte_sched_port_free(struct rte_sched_port *port) > { > - /* Check user parameters */ > - if (port =3D=3D NULL) > - return; > - > - rte_bitmap_free(port->bmp); > rte_free(port); > } >=20 > -- > 2.1.4 Hi Steve, I agree these functions are not doing much at the moment, but I would like = to keep them for the reasons below: 1. There might be people using them, and we do not want to break their code= . Removing them is an ABI change. 2. Although they are just placeholders for now, we might need to add more f= unctionality to them going forward, as the implementation evolves. I don't = want to change the API now by removing them, and change the API later when = we need to add them back. Generally, I think it is good practice to have fr= ee functions. Regards, Cristian