DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>
Subject: [dpdk-dev] [PATCH 07/11] eal: remove unnecessary cast of void pointer
Date: Fri,  7 Apr 2017 13:44:53 -0400	[thread overview]
Message-ID: <20170407174457.4180-8-stephen@networkplumber.org> (raw)
In-Reply-To: <20170407174457.4180-1-stephen@networkplumber.org>

Remove unnecessary casts of void * pointers to a specfic type.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/librte_eal/bsdapp/eal/eal.c          | 4 ++--
 lib/librte_eal/linuxapp/eal/eal.c        | 2 +-
 lib/librte_eal/linuxapp/eal/eal_memory.c | 8 ++++----
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/lib/librte_eal/bsdapp/eal/eal.c b/lib/librte_eal/bsdapp/eal/eal.c
index fae6c7e0a..dbea0354c 100644
--- a/lib/librte_eal/bsdapp/eal/eal.c
+++ b/lib/librte_eal/bsdapp/eal/eal.c
@@ -195,7 +195,7 @@ rte_eal_config_create(void)
 		rte_panic("Cannot mmap memory for rte_config\n");
 	}
 	memcpy(rte_mem_cfg_addr, &early_mem_config, sizeof(early_mem_config));
-	rte_config.mem_config = (struct rte_mem_config *) rte_mem_cfg_addr;
+	rte_config.mem_config = rte_mem_cfg_addr;
 }
 
 /* attach to an existing shared memory config */
@@ -220,7 +220,7 @@ rte_eal_config_attach(void)
 	if (rte_mem_cfg_addr == MAP_FAILED)
 		rte_panic("Cannot mmap memory for rte_config\n");
 
-	rte_config.mem_config = (struct rte_mem_config *) rte_mem_cfg_addr;
+	rte_config.mem_config = rte_mem_cfg_addr;
 }
 
 /* Detect if we are a primary or a secondary process */
diff --git a/lib/librte_eal/linuxapp/eal/eal.c b/lib/librte_eal/linuxapp/eal/eal.c
index d98d56d2f..266150c22 100644
--- a/lib/librte_eal/linuxapp/eal/eal.c
+++ b/lib/librte_eal/linuxapp/eal/eal.c
@@ -212,7 +212,7 @@ rte_eal_config_create(void)
 		rte_panic("Cannot mmap memory for rte_config\n");
 	}
 	memcpy(rte_mem_cfg_addr, &early_mem_config, sizeof(early_mem_config));
-	rte_config.mem_config = (struct rte_mem_config *) rte_mem_cfg_addr;
+	rte_config.mem_config = rte_mem_cfg_addr;
 
 	/* store address of the config in the config itself so that secondary
 	 * processes could later map the config into this exact location */
diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c
index 657c6f449..90cc3224b 100644
--- a/lib/librte_eal/linuxapp/eal/eal_memory.c
+++ b/lib/librte_eal/linuxapp/eal/eal_memory.c
@@ -610,12 +610,12 @@ static int
 cmp_physaddr(const void *a, const void *b)
 {
 #ifndef RTE_ARCH_PPC_64
-	const struct hugepage_file *p1 = (const struct hugepage_file *)a;
-	const struct hugepage_file *p2 = (const struct hugepage_file *)b;
+	const struct hugepage_file *p1 = a;
+	const struct hugepage_file *p2 = b;
 #else
 	/* PowerPC needs memory sorted in reverse order from x86 */
-	const struct hugepage_file *p1 = (const struct hugepage_file *)b;
-	const struct hugepage_file *p2 = (const struct hugepage_file *)a;
+	const struct hugepage_file *p1 = b;
+	const struct hugepage_file *p2 = a;
 #endif
 	if (p1->physaddr < p2->physaddr)
 		return -1;
-- 
2.11.0

  parent reply	other threads:[~2017-04-07 17:45 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-07 17:44 [dpdk-dev] [PATCH 00/11] remove unnecessary cast of void pointers Stephen Hemminger
2017-04-07 17:44 ` [dpdk-dev] [PATCH 01/11] table: remove unnecessary void cast Stephen Hemminger
2017-04-07 17:44 ` [dpdk-dev] [PATCH 02/11] kni: remove unnecessary cast of void pointers Stephen Hemminger
2017-04-10  9:29   ` Ferruh Yigit
2017-04-07 17:44 ` [dpdk-dev] [PATCH 03/11] vhost: remove unnecessary cast of void pointer Stephen Hemminger
2017-04-07 17:44 ` [dpdk-dev] [PATCH 04/11] port: remove unnecessary cast of void pointers Stephen Hemminger
2017-04-07 17:44 ` [dpdk-dev] [PATCH 05/11] crypto: remove unnecessary cast of void pointer Stephen Hemminger
2017-04-07 17:44 ` [dpdk-dev] [PATCH 06/11] acl: " Stephen Hemminger
2017-04-07 17:44 ` Stephen Hemminger [this message]
2017-04-07 17:44 ` [dpdk-dev] [PATCH 08/11] net: remmove " Stephen Hemminger
2017-04-07 17:44 ` [dpdk-dev] [PATCH 09/11] ether: remove " Stephen Hemminger
2017-04-07 17:44 ` [dpdk-dev] [PATCH 10/11] mempool: " Stephen Hemminger
2017-04-07 17:44 ` [dpdk-dev] [PATCH 11/11] test: " Stephen Hemminger
2017-04-08 19:42 ` [dpdk-dev] [PATCH 00/11] remove unnecessary cast of void pointers Thomas Monjalon
2017-04-11 16:06 ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170407174457.4180-8-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).