From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f48.google.com (mail-pa0-f48.google.com [209.85.220.48]) by dpdk.org (Postfix) with ESMTP id EA23E5A33 for ; Fri, 28 Aug 2015 18:49:52 +0200 (CEST) Received: by padfo6 with SMTP id fo6so29633975pad.0 for ; Fri, 28 Aug 2015 09:49:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=KeYtPLmQZ6+il14oP9W2IWeHQ2juar1dRaKv0eTrb8c=; b=Je484GXxOsutl7FIYF71JtPb9aF3MD6H27VChwTQW9es6dZV83qfhdT7Vzxx7VLbMh nMV7OGbWq+J8GsydxuTNS6vTFIUTwOUW00ZhbSGg7seFdONzrzB193Xh5Vj+1vwzLXXO We6nE1BdlrVlyr3M0PswJtLizq4VK+4XsRaS+ZoL83b/cjgz2CcTrKA77VphgZnw6GE/ xznkHjWAJovmI7k2YUyz4OF49359R4VR9n/waPJBRWqMCNYa+v8DJS3Ws3QENQWBu/kZ +/GqLr1tQBI9BIPepnEJXK+wKC71yqTCB/TQIxJ0GFt16+0+sSGzHFfVUAo4jZg/lBa6 Yw5Q== X-Gm-Message-State: ALoCoQn4TX92CilPnm/qNEUoulTtEfhsduuS6HngGKEDcQk0E73Z7SpBn9Q02Ui3f4V80C32y6OI X-Received: by 10.68.250.98 with SMTP id zb2mr16894096pbc.40.1440780592344; Fri, 28 Aug 2015 09:49:52 -0700 (PDT) Received: from urahara.home.lan (static-50-53-82-155.bvtn.or.frontiernet.net. [50.53.82.155]) by smtp.gmail.com with ESMTPSA id mv4sm6273970pdb.51.2015.08.28.09.49.51 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 28 Aug 2015 09:49:51 -0700 (PDT) From: Stephen Hemminger To: cristian.dumitrescu@intel.com Date: Fri, 28 Aug 2015 09:49:59 -0700 Message-Id: <1440780599-14851-3-git-send-email-stephen@networkplumber.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1440780599-14851-1-git-send-email-stephen@networkplumber.org> References: <1440780599-14851-1-git-send-email-stephen@networkplumber.org> Cc: dev@dpdk.org Subject: [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, 28 Aug 2015 16:49:53 -0000 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 --- 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