From mboxrd@z Thu Jan 1 00:00:00 1970 From: Zhiyong Yang Subject: [PATCH 2/5] lib/librte_efd: remove unnecessary void * pointer cast using rte_zmalloc_socket Date: Mon, 15 Jan 2018 15:55:07 +0800 Message-ID: <20180115075510.29348-3-zhiyong.yang@intel.com> References: <20180115075510.29348-1-zhiyong.yang@intel.com> Cc: ferruh.yigit@intel.com, thomas@monjalon.net, Zhiyong Yang To: dev@dpdk.org Return-path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 10DF41200A for ; Mon, 15 Jan 2018 09:08:20 +0100 (CET) In-Reply-To: <20180115075510.29348-1-zhiyong.yang@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" void * pointer can be assigned to any data type pointer. Unnecessary cast can be removed in order to keep code clearer. Signed-off-by: Zhiyong Yang --- lib/librte_efd/rte_efd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/librte_efd/rte_efd.c b/lib/librte_efd/rte_efd.c index e15ff04c9..a780e2fe8 100644 --- a/lib/librte_efd/rte_efd.c +++ b/lib/librte_efd/rte_efd.c @@ -558,7 +558,7 @@ rte_efd_create(const char *name, uint32_t max_num_rules, uint32_t key_len, } /* Create a new EFD table management structure */ - table = (struct rte_efd_table *) rte_zmalloc_socket(NULL, + table = rte_zmalloc_socket(NULL, sizeof(struct rte_efd_table), RTE_CACHE_LINE_SIZE, offline_cpu_socket); @@ -580,7 +580,7 @@ rte_efd_create(const char *name, uint32_t max_num_rules, uint32_t key_len, table->key_len = key_len; /* key_array */ - key_array = (uint8_t *) rte_zmalloc_socket(NULL, + key_array = rte_zmalloc_socket(NULL, table->max_num_rules * table->key_len, RTE_CACHE_LINE_SIZE, offline_cpu_socket); @@ -616,7 +616,7 @@ rte_efd_create(const char *name, uint32_t max_num_rules, uint32_t key_len, * as a continuous block */ table->chunks[socket_id] = - (struct efd_online_chunk *) rte_zmalloc_socket( + rte_zmalloc_socket( NULL, online_table_size, RTE_CACHE_LINE_SIZE, @@ -666,7 +666,7 @@ rte_efd_create(const char *name, uint32_t max_num_rules, uint32_t key_len, */ offline_table_size = num_chunks * sizeof(struct efd_offline_chunk_rules); table->offline_chunks = - (struct efd_offline_chunk_rules *) rte_zmalloc_socket(NULL, + rte_zmalloc_socket(NULL, offline_table_size, RTE_CACHE_LINE_SIZE, offline_cpu_socket); -- 2.13.3