From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f41.google.com (mail-pa0-f41.google.com [209.85.220.41]) by dpdk.org (Postfix) with ESMTP id 996FDC494 for ; Fri, 24 Jul 2015 19:06:26 +0200 (CEST) Received: by pacan13 with SMTP id an13so17466232pac.1 for ; Fri, 24 Jul 2015 10:06:26 -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=ginKC2y4gPh13quva3vWyB1HiK+P8QQBtNijTBXjU6g=; b=REsIy+0TcNVgQOE1f6IXtKfsp+8o1bs2iTIgSB9bH2OSoL8I9IJMISRTwzqo25ntrp 2sxg0s1MGXrZtgpdPLrzZlqpnKJMvqXtGVCzyxGnOzmlEfZmgXodwt5j9QAafz5piX0i CFhzmjsTgP+vIfqi/9Qc/g6CxgYbH+aFzze40MXuEEBef5MXx+29upwWQWp+sgW7F83O SrpJ9zeQddM6x/NDgXbPCpOpAJ1JLfS8ykAYVOtCLCKLuAGxonBRe04dCvOfHPk6+8J0 LoCjI1Pj/85DZFIjqjx5jUth4KGgNsTd0o91MuJ5dpWvj6gx5l/MYgkruHEKCeyGHf4u sPuQ== X-Gm-Message-State: ALoCoQlkJXM5fUBU21hNO8km9TOTc5FWXc1gFiWUgD7h3oCH+A7PAl9THLAr7aMAP7qvJXVxJh7H X-Received: by 10.70.31.130 with SMTP id a2mr33409807pdi.61.1437757585934; Fri, 24 Jul 2015 10:06:25 -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 ra10sm15635403pab.19.2015.07.24.10.06.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 24 Jul 2015 10:06:25 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Date: Fri, 24 Jul 2015 10:06:20 -0700 Message-Id: <1437757584-15502-8-git-send-email-stephen@networkplumber.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1437757584-15502-1-git-send-email-stephen@networkplumber.org> References: <1437757584-15502-1-git-send-email-stephen@networkplumber.org> Subject: [dpdk-dev] [PATCH 07/11] lpm: remove useless casts 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, 24 Jul 2015 17:06:27 -0000 Found by modified coccinelle script. lib/librte_lpm/rte_lpm6.c:196:8-23: WARNING: casting value returned by memory allocation function to (struct rte_lpm6 *) is useless. lib/librte_lpm/rte_lpm6.c:205:19-39: WARNING: casting value returned by memory allocation function to (struct rte_lpm6_rule *) is useless. lib/librte_lpm/rte_lpm.c:195:8-22: WARNING: casting value returned by memory allocation function to (struct rte_lpm *) is useless. Signed-off-by: Stephen Hemminger --- lib/librte_lpm/rte_lpm.c | 4 ++-- lib/librte_lpm/rte_lpm6.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/librte_lpm/rte_lpm.c b/lib/librte_lpm/rte_lpm.c index de05307..e71bd15 100644 --- a/lib/librte_lpm/rte_lpm.c +++ b/lib/librte_lpm/rte_lpm.c @@ -192,8 +192,8 @@ rte_lpm_create(const char *name, int socket_id, int max_rules, } /* Allocate memory to store the LPM data structures. */ - lpm = (struct rte_lpm *)rte_zmalloc_socket(mem_name, mem_size, - RTE_CACHE_LINE_SIZE, socket_id); + lpm = rte_zmalloc_socket(mem_name, mem_size, + RTE_CACHE_LINE_SIZE, socket_id); if (lpm == NULL) { RTE_LOG(ERR, LPM, "LPM memory allocation failed\n"); rte_free(te); diff --git a/lib/librte_lpm/rte_lpm6.c b/lib/librte_lpm/rte_lpm6.c index 6c2b293..ec2d482 100644 --- a/lib/librte_lpm/rte_lpm6.c +++ b/lib/librte_lpm/rte_lpm6.c @@ -193,8 +193,8 @@ rte_lpm6_create(const char *name, int socket_id, } /* Allocate memory to store the LPM data structures. */ - lpm = (struct rte_lpm6 *)rte_zmalloc_socket(mem_name, (size_t)mem_size, - RTE_CACHE_LINE_SIZE, socket_id); + lpm = rte_zmalloc_socket(mem_name, (size_t)mem_size, + RTE_CACHE_LINE_SIZE, socket_id); if (lpm == NULL) { RTE_LOG(ERR, LPM, "LPM memory allocation failed\n"); @@ -202,8 +202,8 @@ rte_lpm6_create(const char *name, int socket_id, goto exit; } - lpm->rules_tbl = (struct rte_lpm6_rule *)rte_zmalloc_socket(NULL, - (size_t)rules_size, RTE_CACHE_LINE_SIZE, socket_id); + lpm->rules_tbl = rte_zmalloc_socket(NULL, (size_t)rules_size, + RTE_CACHE_LINE_SIZE, socket_id); if (lpm->rules_tbl == NULL) { RTE_LOG(ERR, LPM, "LPM memory allocation failed\n"); -- 2.1.4