From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f42.google.com (mail-pa0-f42.google.com [209.85.220.42]) by dpdk.org (Postfix) with ESMTP id 4B052C494 for ; Fri, 24 Jul 2015 19:06:28 +0200 (CEST) Received: by pachj5 with SMTP id hj5so17138021pac.3 for ; Fri, 24 Jul 2015 10:06:27 -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=bI8ElIsSYgFlu1xcMrM9Vl370KAZAIjnUzLIZqcBmIk=; b=Y/joQak884bw1gW035//5wI9fvpECwOSvAnD8nnpRd7AjwNjv1RW+oCRn9vJMRZIRU FduPSXTR7z15AbJfjQI6jmBTOwb8Po6/Ua5Dyuda9E60hxoezgnoKd9ACSF/SLYW8IRf vjaVEFS7QWaOoEnIyKlZOnpb2H7OJiNeUyEnuCwv7mlS3CF3lg62tW1r4wXwbrPClO6e jMWtd5b0L2UQqx36uHIpCTp6HRUWYk0Akt6hxogOdx1i7OzijMDnZjGlhJguKlmqVEpQ a00Ng2f2T76tIVJgAFGFMNiNHlDzE15667io868EjDJKHUmu2rS5zev0c2kQALIpXxnz Djcw== X-Gm-Message-State: ALoCoQmgwyoouaw3DrNvYETMIXLe4pn+JBDJQ91Jo3Z/5OnMP7a4I/tUicZgx5EkNNqG+nuzyxTZ X-Received: by 10.70.45.225 with SMTP id q1mr33320423pdm.46.1437757587714; Fri, 24 Jul 2015 10:06:27 -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:26 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Date: Fri, 24 Jul 2015 10:06:21 -0700 Message-Id: <1437757584-15502-9-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 08/11] hash: 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:28 -0000 Found by coccinelle. lib/librte_hash/rte_fbk_hash.c:153:7-32: WARNING: casting value returned by memory allocation function to (struct rte_fbk_hash_table *) is useless. lib/librte_hash/rte_cuckoo_hash.c:218:6-21: WARNING: casting value returned by memory allocation function to (struct rte_hash *) is useless. Signed-off-by: Stephen Hemminger --- lib/librte_hash/rte_cuckoo_hash.c | 4 ++-- lib/librte_hash/rte_fbk_hash.c | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/librte_hash/rte_cuckoo_hash.c b/lib/librte_hash/rte_cuckoo_hash.c index 5cf4af6..3a4f5e9 100644 --- a/lib/librte_hash/rte_cuckoo_hash.c +++ b/lib/librte_hash/rte_cuckoo_hash.c @@ -215,8 +215,8 @@ rte_hash_create(const struct rte_hash_parameters *params) goto err; } - h = (struct rte_hash *)rte_zmalloc_socket(hash_name, sizeof(struct rte_hash), - RTE_CACHE_LINE_SIZE, params->socket_id); + h = rte_zmalloc_socket(hash_name, sizeof(struct rte_hash), + RTE_CACHE_LINE_SIZE, params->socket_id); if (h == NULL) { RTE_LOG(ERR, HASH, "memory allocation failed\n"); diff --git a/lib/librte_hash/rte_fbk_hash.c b/lib/librte_hash/rte_fbk_hash.c index 8752a47..4c27756 100644 --- a/lib/librte_hash/rte_fbk_hash.c +++ b/lib/librte_hash/rte_fbk_hash.c @@ -150,8 +150,7 @@ rte_fbk_hash_create(const struct rte_fbk_hash_params *params) } /* Allocate memory for table. */ - ht = (struct rte_fbk_hash_table *)rte_zmalloc_socket(hash_name, mem_size, - 0, params->socket_id); + ht = rte_zmalloc_socket(hash_name, mem_size, 0, params->socket_id); if (ht == NULL) { RTE_LOG(ERR, HASH, "Failed to allocate fbk hash table\n"); rte_free(te); -- 2.1.4