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 at 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