DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: cristian.dumitrescu@intel.com
Cc: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 2/2] rte_sched: remove useless bitmap_free
Date: Fri, 28 Aug 2015 09:49:59 -0700	[thread overview]
Message-ID: <1440780599-14851-3-git-send-email-stephen@networkplumber.org> (raw)
In-Reply-To: <1440780599-14851-1-git-send-email-stephen@networkplumber.org>

Coverity reports that rte_bitmap_free() does nothing and caller does
not check return value. Just remove it.

Also since rte_free(NULL) is a nop, remove useless check here.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/librte_sched/rte_bitmap.h | 19 -------------------
 lib/librte_sched/rte_sched.c  |  5 -----
 2 files changed, 24 deletions(-)

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)
 }
 
 /**
- * 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 == 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 == NULL)
-		return;
-
-	rte_bitmap_free(port->bmp);
 	rte_free(port);
 }
 
-- 
2.1.4

  parent reply	other threads:[~2015-08-28 16:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-28 16:49 [dpdk-dev] [PATCH 0/2] rte_sched: cleanups Stephen Hemminger
2015-08-28 16:49 ` [dpdk-dev] [PATCH 1/2] rte_sched: whitespace cleanup Stephen Hemminger
2015-09-11 17:31   ` Dumitrescu, Cristian
2015-09-11 19:18     ` Stephen Hemminger
2015-08-28 16:49 ` Stephen Hemminger [this message]
2015-09-11 17:28   ` [dpdk-dev] [PATCH 2/2] rte_sched: remove useless bitmap_free Dumitrescu, Cristian
2015-09-11 19:18     ` Stephen Hemminger

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=1440780599-14851-3-git-send-email-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=cristian.dumitrescu@intel.com \
    --cc=dev@dpdk.org \
    /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 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).