All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/11] remove unnecessary cast of void pointers
@ 2017-04-07 17:44 Stephen Hemminger
  2017-04-07 17:44 ` [PATCH 01/11] table: remove unnecessary void cast Stephen Hemminger
                   ` (12 more replies)
  0 siblings, 13 replies; 15+ messages in thread
From: Stephen Hemminger @ 2017-04-07 17:44 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

This is a set patches inspired by a set of Linux kernel patches
by simran singhal <singhalsimran0@gmail.com>

The following Coccinelle script was used to detect this:
@r@
expression x;
void* e;
type T;
identifier f;
@@
(
  *((T *)e)
|
  ((T *)x)[...]
|
  ((T*)x)->f
|

- (T*)
  e
)

Stephen Hemminger (11):
  table: remove unnecessary void cast
  kni: remove unnecessary cast of void pointers
  vhost: remove unnecessary cast of void pointer
  port: remove unnecessary cast of void pointers
  crypto: remove unnecessary cast of void pointer
  acl: remove unnecessary cast of void pointer
  eal: remove unnecessary cast of void pointer
  net: remmove unnecessary cast of void pointer
  ether: remove unnecessary cast of void pointer
  mempool: remove unnecessary cast of void pointer
  test: remove unnecessary cast of void pointer

 lib/librte_acl/acl_bld.c                           |  8 ++---
 lib/librte_cryptodev/rte_cryptodev.c               |  4 +--
 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 ++---
 .../linuxapp/kni/ethtool/igb/igb_ethtool.c         |  2 +-
 lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c |  8 ++---
 .../linuxapp/kni/ethtool/ixgbe/ixgbe_ethtool.c     |  4 +--
 lib/librte_eal/linuxapp/kni/kni_misc.c             |  2 +-
 lib/librte_ether/rte_ethdev.c                      |  2 +-
 lib/librte_mempool/rte_mempool.c                   |  2 +-
 lib/librte_net/rte_net_crc.c                       |  2 +-
 lib/librte_port/rte_port_ethdev.c                  | 26 +++++++-------
 lib/librte_port/rte_port_fd.c                      | 26 +++++++-------
 lib/librte_port/rte_port_frag.c                    |  6 ++--
 lib/librte_port/rte_port_kni.c                     | 26 +++++++-------
 lib/librte_port/rte_port_ras.c                     | 12 +++----
 lib/librte_port/rte_port_ring.c                    | 40 +++++++++++-----------
 lib/librte_port/rte_port_sched.c                   | 10 +++---
 lib/librte_port/rte_port_source_sink.c             | 20 +++++------
 lib/librte_table/rte_table_acl.c                   | 24 ++++++-------
 lib/librte_table/rte_table_array.c                 | 11 +++---
 lib/librte_table/rte_table_hash_cuckoo.c           |  8 ++---
 lib/librte_table/rte_table_hash_ext.c              | 10 +++---
 lib/librte_table/rte_table_hash_key16.c            | 14 ++++----
 lib/librte_table/rte_table_hash_key32.c            | 16 ++++-----
 lib/librte_table/rte_table_hash_key8.c             | 14 ++++----
 lib/librte_table/rte_table_hash_lru.c              | 10 +++---
 lib/librte_table/rte_table_lpm.c                   | 14 ++++----
 lib/librte_table/rte_table_lpm_ipv6.c              | 14 ++++----
 lib/librte_table/rte_table_stub.c                  |  2 +-
 lib/librte_vhost/virtio_net.c                      |  6 ++--
 test/test-pipeline/pipeline_hash.c                 |  2 +-
 test/test/test_efd.c                               |  2 +-
 test/test/test_interrupts.c                        |  4 +--
 test/test/test_mbuf.c                              |  2 +-
 test/test/test_table.c                             |  2 +-
 test/test/test_table_acl.c                         |  2 +-
 test/test/test_table_pipeline.c                    |  2 +-
 test/test/virtual_pmd.c                            |  4 +--
 40 files changed, 188 insertions(+), 189 deletions(-)

-- 
2.11.0

^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH 01/11] table: remove unnecessary void cast
  2017-04-07 17:44 [PATCH 00/11] remove unnecessary cast of void pointers Stephen Hemminger
@ 2017-04-07 17:44 ` Stephen Hemminger
  2017-04-07 17:44 ` [PATCH 02/11] kni: remove unnecessary cast of void pointers Stephen Hemminger
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: Stephen Hemminger @ 2017-04-07 17:44 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

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

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/librte_table/rte_table_acl.c         | 24 ++++++++++++------------
 lib/librte_table/rte_table_array.c       | 11 +++++------
 lib/librte_table/rte_table_hash_cuckoo.c |  8 ++++----
 lib/librte_table/rte_table_hash_ext.c    | 10 +++++-----
 lib/librte_table/rte_table_hash_key16.c  | 14 +++++++-------
 lib/librte_table/rte_table_hash_key32.c  | 16 ++++++++--------
 lib/librte_table/rte_table_hash_key8.c   | 14 +++++++-------
 lib/librte_table/rte_table_hash_lru.c    | 10 +++++-----
 lib/librte_table/rte_table_lpm.c         | 14 +++++++-------
 lib/librte_table/rte_table_lpm_ipv6.c    | 14 +++++++-------
 lib/librte_table/rte_table_stub.c        |  2 +-
 11 files changed, 68 insertions(+), 69 deletions(-)

diff --git a/lib/librte_table/rte_table_acl.c b/lib/librte_table/rte_table_acl.c
index 94b69a983..3c05e4a87 100644
--- a/lib/librte_table/rte_table_acl.c
+++ b/lib/librte_table/rte_table_acl.c
@@ -87,7 +87,7 @@ rte_table_acl_create(
 	int socket_id,
 	uint32_t entry_size)
 {
-	struct rte_table_acl_params *p = (struct rte_table_acl_params *) params;
+	struct rte_table_acl_params *p = params;
 	struct rte_table_acl *acl;
 	uint32_t action_table_size, acl_rule_list_size, acl_rule_memory_size;
 	uint32_t total_size;
@@ -168,7 +168,7 @@ rte_table_acl_create(
 static int
 rte_table_acl_free(void *table)
 {
-	struct rte_table_acl *acl = (struct rte_table_acl *) table;
+	struct rte_table_acl *acl = table;
 
 	/* Check input parameters */
 	if (table == NULL) {
@@ -248,9 +248,9 @@ rte_table_acl_entry_add(
 	int *key_found,
 	void **entry_ptr)
 {
-	struct rte_table_acl *acl = (struct rte_table_acl *) table;
+	struct rte_table_acl *acl = table;
 	struct rte_table_acl_rule_add_params *rule =
-		(struct rte_table_acl_rule_add_params *) key;
+		key;
 	struct rte_pipeline_acl_rule acl_rule;
 	struct rte_acl_rule *rule_location;
 	struct rte_acl_ctx *ctx;
@@ -366,9 +366,9 @@ rte_table_acl_entry_delete(
 	int *key_found,
 	void *entry)
 {
-	struct rte_table_acl *acl = (struct rte_table_acl *) table;
+	struct rte_table_acl *acl = table;
 	struct rte_table_acl_rule_delete_params *rule =
-		(struct rte_table_acl_rule_delete_params *) key;
+		key;
 	struct rte_acl_rule *deleted_rule = NULL;
 	struct rte_acl_ctx *ctx;
 	uint32_t pos, pos_valid, i;
@@ -450,7 +450,7 @@ rte_table_acl_entry_add_bulk(
 	int *key_found,
 	void **entries_ptr)
 {
-	struct rte_table_acl *acl = (struct rte_table_acl *) table;
+	struct rte_table_acl *acl = table;
 	struct rte_acl_ctx *ctx;
 	uint32_t rule_pos[n_keys];
 	uint32_t i;
@@ -507,7 +507,7 @@ rte_table_acl_entry_add_bulk(
 			return -EINVAL;
 		}
 
-		rule = (struct rte_table_acl_rule_add_params *) keys[i];
+		rule = keys[i];
 		if (rule->priority > RTE_ACL_MAX_PRIORITY) {
 			RTE_LOG(ERR, TABLE, "%s: Priority is too high\n", __func__);
 			return -EINVAL;
@@ -518,7 +518,7 @@ rte_table_acl_entry_add_bulk(
 	memset(key_found, 0, n_keys * sizeof(int));
 	for (i = 0; i < n_keys; i++) {
 		struct rte_table_acl_rule_add_params *rule =
-				(struct rte_table_acl_rule_add_params *) keys[i];
+				keys[i];
 		struct rte_pipeline_acl_rule acl_rule;
 		struct rte_acl_rule *rule_location;
 		uint32_t free_pos, free_pos_valid, j;
@@ -636,7 +636,7 @@ rte_table_acl_entry_delete_bulk(
 	int *key_found,
 	void **entries)
 {
-	struct rte_table_acl *acl = (struct rte_table_acl *) table;
+	struct rte_table_acl *acl = table;
 	struct rte_acl_rule *deleted_rules[n_keys];
 	uint32_t rule_pos[n_keys];
 	struct rte_acl_ctx *ctx;
@@ -675,7 +675,7 @@ rte_table_acl_entry_delete_bulk(
 	memset(rule_pos, 0, n_keys * sizeof(uint32_t));
 	for (i = 0; i < n_keys; i++) {
 		struct rte_table_acl_rule_delete_params *rule =
-			(struct rte_table_acl_rule_delete_params *) keys[i];
+			keys[i];
 		uint32_t pos_valid, j;
 
 		/* Look for the rule in the table */
@@ -810,7 +810,7 @@ rte_table_acl_lookup(
 static int
 rte_table_acl_stats_read(void *table, struct rte_table_stats *stats, int clear)
 {
-	struct rte_table_acl *acl = (struct rte_table_acl *) table;
+	struct rte_table_acl *acl = table;
 
 	if (stats != NULL)
 		memcpy(stats, &acl->stats, sizeof(acl->stats));
diff --git a/lib/librte_table/rte_table_array.c b/lib/librte_table/rte_table_array.c
index 3bb68d112..cf7be88ae 100644
--- a/lib/librte_table/rte_table_array.c
+++ b/lib/librte_table/rte_table_array.c
@@ -74,8 +74,7 @@ struct rte_table_array {
 static void *
 rte_table_array_create(void *params, int socket_id, uint32_t entry_size)
 {
-	struct rte_table_array_params *p =
-		(struct rte_table_array_params *) params;
+	struct rte_table_array_params *p = params;
 	struct rte_table_array *t;
 	uint32_t total_cl_size, total_size;
 
@@ -111,7 +110,7 @@ rte_table_array_create(void *params, int socket_id, uint32_t entry_size)
 static int
 rte_table_array_free(void *table)
 {
-	struct rte_table_array *t = (struct rte_table_array *) table;
+	struct rte_table_array *t = table;
 
 	/* Check input parameters */
 	if (t == NULL) {
@@ -133,8 +132,8 @@ rte_table_array_entry_add(
 	int *key_found,
 	void **entry_ptr)
 {
-	struct rte_table_array *t = (struct rte_table_array *) table;
-	struct rte_table_array_key *k = (struct rte_table_array_key *) key;
+	struct rte_table_array *t = table;
+	struct rte_table_array_key *k = key;
 	uint8_t *table_entry;
 
 	/* Check input parameters */
@@ -214,7 +213,7 @@ rte_table_array_lookup(
 static int
 rte_table_array_stats_read(void *table, struct rte_table_stats *stats, int clear)
 {
-	struct rte_table_array *array = (struct rte_table_array *) table;
+	struct rte_table_array *array = table;
 
 	if (stats != NULL)
 		memcpy(stats, &array->stats, sizeof(array->stats));
diff --git a/lib/librte_table/rte_table_hash_cuckoo.c b/lib/librte_table/rte_table_hash_cuckoo.c
index ff7baee30..da1597fad 100644
--- a/lib/librte_table/rte_table_hash_cuckoo.c
+++ b/lib/librte_table/rte_table_hash_cuckoo.c
@@ -190,7 +190,7 @@ rte_table_hash_cuckoo_free(void *table) {
 		return -EINVAL;
 	}
 
-	struct rte_table_hash *t = (struct rte_table_hash *)table;
+	struct rte_table_hash *t = table;
 
 	rte_hash_free(t->h_table);
 	rte_free(t);
@@ -218,7 +218,7 @@ rte_table_hash_cuckoo_entry_add(void *table, void *key, void *entry,
 		return -EINVAL;
 	}
 
-	struct rte_table_hash *t = (struct rte_table_hash *)table;
+	struct rte_table_hash *t = table;
 
 	/*  Find Existing entries */
 	pos = rte_hash_lookup(t->h_table, key);
@@ -268,7 +268,7 @@ rte_table_hash_cuckoo_entry_delete(void *table, void *key,
 		return -EINVAL;
 	}
 
-	struct rte_table_hash *t = (struct rte_table_hash *)table;
+	struct rte_table_hash *t = table;
 
 	pos = rte_hash_del_key(t->h_table, key);
 	if (pos >= 0) {
@@ -359,7 +359,7 @@ static int
 rte_table_hash_cuckoo_stats_read(void *table, struct rte_table_stats *stats,
 	int clear)
 {
-	struct rte_table_hash *t = (struct rte_table_hash *) table;
+	struct rte_table_hash *t = table;
 
 	if (stats != NULL)
 		memcpy(stats, &t->stats, sizeof(t->stats));
diff --git a/lib/librte_table/rte_table_hash_ext.c b/lib/librte_table/rte_table_hash_ext.c
index e283a3d14..ff9d673a8 100644
--- a/lib/librte_table/rte_table_hash_ext.c
+++ b/lib/librte_table/rte_table_hash_ext.c
@@ -172,7 +172,7 @@ static void *
 rte_table_hash_ext_create(void *params, int socket_id, uint32_t entry_size)
 {
 	struct rte_table_hash_ext_params *p =
-		(struct rte_table_hash_ext_params *) params;
+		params;
 	struct rte_table_hash *t;
 	uint32_t total_size, table_meta_sz;
 	uint32_t bucket_sz, bucket_ext_sz, key_sz;
@@ -258,7 +258,7 @@ rte_table_hash_ext_create(void *params, int socket_id, uint32_t entry_size)
 static int
 rte_table_hash_ext_free(void *table)
 {
-	struct rte_table_hash *t = (struct rte_table_hash *) table;
+	struct rte_table_hash *t = table;
 
 	/* Check input parameters */
 	if (t == NULL)
@@ -272,7 +272,7 @@ static int
 rte_table_hash_ext_entry_add(void *table, void *key, void *entry,
 	int *key_found, void **entry_ptr)
 {
-	struct rte_table_hash *t = (struct rte_table_hash *) table;
+	struct rte_table_hash *t = table;
 	struct bucket *bkt0, *bkt, *bkt_prev;
 	uint64_t sig;
 	uint32_t bkt_index, i;
@@ -373,7 +373,7 @@ static int
 rte_table_hash_ext_entry_delete(void *table, void *key, int *key_found,
 void *entry)
 {
-	struct rte_table_hash *t = (struct rte_table_hash *) table;
+	struct rte_table_hash *t = table;
 	struct bucket *bkt0, *bkt, *bkt_prev;
 	uint64_t sig;
 	uint32_t bkt_index, i;
@@ -1125,7 +1125,7 @@ static int rte_table_hash_ext_lookup_dosig(
 static int
 rte_table_hash_ext_stats_read(void *table, struct rte_table_stats *stats, int clear)
 {
-	struct rte_table_hash *t = (struct rte_table_hash *) table;
+	struct rte_table_hash *t = table;
 
 	if (stats != NULL)
 		memcpy(stats, &t->stats, sizeof(t->stats));
diff --git a/lib/librte_table/rte_table_hash_key16.c b/lib/librte_table/rte_table_hash_key16.c
index 08d4d77eb..ce057b785 100644
--- a/lib/librte_table/rte_table_hash_key16.c
+++ b/lib/librte_table/rte_table_hash_key16.c
@@ -187,7 +187,7 @@ rte_table_hash_create_key16_lru(void *params,
 static int
 rte_table_hash_free_key16_lru(void *table)
 {
-	struct rte_table_hash *f = (struct rte_table_hash *) table;
+	struct rte_table_hash *f = table;
 
 	/* Check input parameters */
 	if (f == NULL) {
@@ -207,7 +207,7 @@ rte_table_hash_entry_add_key16_lru(
 	int *key_found,
 	void **entry_ptr)
 {
-	struct rte_table_hash *f = (struct rte_table_hash *) table;
+	struct rte_table_hash *f = table;
 	struct rte_bucket_4_16 *bucket;
 	uint64_t signature, pos;
 	uint32_t bucket_index, i;
@@ -273,7 +273,7 @@ rte_table_hash_entry_delete_key16_lru(
 	int *key_found,
 	void *entry)
 {
-	struct rte_table_hash *f = (struct rte_table_hash *) table;
+	struct rte_table_hash *f = table;
 	struct rte_bucket_4_16 *bucket;
 	uint64_t signature;
 	uint32_t bucket_index, i;
@@ -407,7 +407,7 @@ rte_table_hash_create_key16_ext(void *params,
 static int
 rte_table_hash_free_key16_ext(void *table)
 {
-	struct rte_table_hash *f = (struct rte_table_hash *) table;
+	struct rte_table_hash *f = table;
 
 	/* Check input parameters */
 	if (f == NULL) {
@@ -427,7 +427,7 @@ rte_table_hash_entry_add_key16_ext(
 	int *key_found,
 	void **entry_ptr)
 {
-	struct rte_table_hash *f = (struct rte_table_hash *) table;
+	struct rte_table_hash *f = table;
 	struct rte_bucket_4_16 *bucket0, *bucket, *bucket_prev;
 	uint64_t signature;
 	uint32_t bucket_index, i;
@@ -504,7 +504,7 @@ rte_table_hash_entry_delete_key16_ext(
 	int *key_found,
 	void *entry)
 {
-	struct rte_table_hash *f = (struct rte_table_hash *) table;
+	struct rte_table_hash *f = table;
 	struct rte_bucket_4_16 *bucket0, *bucket, *bucket_prev;
 	uint64_t signature;
 	uint32_t bucket_index, i;
@@ -1463,7 +1463,7 @@ rte_table_hash_lookup_key16_ext_dosig(
 static int
 rte_table_hash_key16_stats_read(void *table, struct rte_table_stats *stats, int clear)
 {
-	struct rte_table_hash *t = (struct rte_table_hash *) table;
+	struct rte_table_hash *t = table;
 
 	if (stats != NULL)
 		memcpy(stats, &t->stats, sizeof(t->stats));
diff --git a/lib/librte_table/rte_table_hash_key32.c b/lib/librte_table/rte_table_hash_key32.c
index 161f6b7a7..31fe6fda4 100644
--- a/lib/librte_table/rte_table_hash_key32.c
+++ b/lib/librte_table/rte_table_hash_key32.c
@@ -179,7 +179,7 @@ rte_table_hash_create_key32_lru(void *params,
 static int
 rte_table_hash_free_key32_lru(void *table)
 {
-	struct rte_table_hash *f = (struct rte_table_hash *) table;
+	struct rte_table_hash *f = table;
 
 	/* Check input parameters */
 	if (f == NULL) {
@@ -199,7 +199,7 @@ rte_table_hash_entry_add_key32_lru(
 	int *key_found,
 	void **entry_ptr)
 {
-	struct rte_table_hash *f = (struct rte_table_hash *) table;
+	struct rte_table_hash *f = table;
 	struct rte_bucket_4_32 *bucket;
 	uint64_t signature, pos;
 	uint32_t bucket_index, i;
@@ -265,7 +265,7 @@ rte_table_hash_entry_delete_key32_lru(
 	int *key_found,
 	void *entry)
 {
-	struct rte_table_hash *f = (struct rte_table_hash *) table;
+	struct rte_table_hash *f = table;
 	struct rte_bucket_4_32 *bucket;
 	uint64_t signature;
 	uint32_t bucket_index, i;
@@ -329,7 +329,7 @@ rte_table_hash_create_key32_ext(void *params,
 	uint32_t entry_size)
 {
 	struct rte_table_hash_key32_ext_params *p =
-			(struct rte_table_hash_key32_ext_params *) params;
+			params;
 	struct rte_table_hash *f;
 	uint32_t n_buckets, n_buckets_ext, n_entries_per_bucket;
 	uint32_t key_size, bucket_size_cl, stack_size_cl, total_size, i;
@@ -392,7 +392,7 @@ rte_table_hash_create_key32_ext(void *params,
 static int
 rte_table_hash_free_key32_ext(void *table)
 {
-	struct rte_table_hash *f = (struct rte_table_hash *) table;
+	struct rte_table_hash *f = table;
 
 	/* Check input parameters */
 	if (f == NULL) {
@@ -412,7 +412,7 @@ rte_table_hash_entry_add_key32_ext(
 	int *key_found,
 	void **entry_ptr)
 {
-	struct rte_table_hash *f = (struct rte_table_hash *) table;
+	struct rte_table_hash *f = table;
 	struct rte_bucket_4_32 *bucket0, *bucket, *bucket_prev;
 	uint64_t signature;
 	uint32_t bucket_index, i;
@@ -492,7 +492,7 @@ rte_table_hash_entry_delete_key32_ext(
 	int *key_found,
 	void *entry)
 {
-	struct rte_table_hash *f = (struct rte_table_hash *) table;
+	struct rte_table_hash *f = table;
 	struct rte_bucket_4_32 *bucket0, *bucket, *bucket_prev;
 	uint64_t signature;
 	uint32_t bucket_index, i;
@@ -1110,7 +1110,7 @@ rte_table_hash_lookup_key32_ext(
 static int
 rte_table_hash_key32_stats_read(void *table, struct rte_table_stats *stats, int clear)
 {
-	struct rte_table_hash *t = (struct rte_table_hash *) table;
+	struct rte_table_hash *t = table;
 
 	if (stats != NULL)
 		memcpy(stats, &t->stats, sizeof(t->stats));
diff --git a/lib/librte_table/rte_table_hash_key8.c b/lib/librte_table/rte_table_hash_key8.c
index b04f60dc8..5f0c65663 100644
--- a/lib/librte_table/rte_table_hash_key8.c
+++ b/lib/librte_table/rte_table_hash_key8.c
@@ -180,7 +180,7 @@ rte_table_hash_create_key8_lru(void *params, int socket_id, uint32_t entry_size)
 static int
 rte_table_hash_free_key8_lru(void *table)
 {
-	struct rte_table_hash *f = (struct rte_table_hash *) table;
+	struct rte_table_hash *f = table;
 
 	/* Check input parameters */
 	if (f == NULL) {
@@ -200,7 +200,7 @@ rte_table_hash_entry_add_key8_lru(
 	int *key_found,
 	void **entry_ptr)
 {
-	struct rte_table_hash *f = (struct rte_table_hash *) table;
+	struct rte_table_hash *f = table;
 	struct rte_bucket_4_8 *bucket;
 	uint64_t signature, mask, pos;
 	uint32_t bucket_index, i;
@@ -263,7 +263,7 @@ rte_table_hash_entry_delete_key8_lru(
 	int *key_found,
 	void *entry)
 {
-	struct rte_table_hash *f = (struct rte_table_hash *) table;
+	struct rte_table_hash *f = table;
 	struct rte_bucket_4_8 *bucket;
 	uint64_t signature, mask;
 	uint32_t bucket_index, i;
@@ -392,7 +392,7 @@ rte_table_hash_create_key8_ext(void *params, int socket_id, uint32_t entry_size)
 static int
 rte_table_hash_free_key8_ext(void *table)
 {
-	struct rte_table_hash *f = (struct rte_table_hash *) table;
+	struct rte_table_hash *f = table;
 
 	/* Check input parameters */
 	if (f == NULL) {
@@ -412,7 +412,7 @@ rte_table_hash_entry_add_key8_ext(
 	int *key_found,
 	void **entry_ptr)
 {
-	struct rte_table_hash *f = (struct rte_table_hash *) table;
+	struct rte_table_hash *f = table;
 	struct rte_bucket_4_8 *bucket0, *bucket, *bucket_prev;
 	uint64_t signature;
 	uint32_t bucket_index, i;
@@ -493,7 +493,7 @@ rte_table_hash_entry_delete_key8_ext(
 	int *key_found,
 	void *entry)
 {
-	struct rte_table_hash *f = (struct rte_table_hash *) table;
+	struct rte_table_hash *f = table;
 	struct rte_bucket_4_8 *bucket0, *bucket, *bucket_prev;
 	uint64_t signature;
 	uint32_t bucket_index, i;
@@ -1415,7 +1415,7 @@ rte_table_hash_lookup_key8_ext_dosig(
 static int
 rte_table_hash_key8_stats_read(void *table, struct rte_table_stats *stats, int clear)
 {
-	struct rte_table_hash *t = (struct rte_table_hash *) table;
+	struct rte_table_hash *t = table;
 
 	if (stats != NULL)
 		memcpy(stats, &t->stats, sizeof(t->stats));
diff --git a/lib/librte_table/rte_table_hash_lru.c b/lib/librte_table/rte_table_hash_lru.c
index 407c62ab8..5a4864e29 100644
--- a/lib/librte_table/rte_table_hash_lru.c
+++ b/lib/librte_table/rte_table_hash_lru.c
@@ -149,7 +149,7 @@ static void *
 rte_table_hash_lru_create(void *params, int socket_id, uint32_t entry_size)
 {
 	struct rte_table_hash_lru_params *p =
-		(struct rte_table_hash_lru_params *) params;
+		params;
 	struct rte_table_hash *t;
 	uint32_t total_size, table_meta_sz;
 	uint32_t bucket_sz, key_sz, key_stack_sz, data_sz;
@@ -227,7 +227,7 @@ rte_table_hash_lru_create(void *params, int socket_id, uint32_t entry_size)
 static int
 rte_table_hash_lru_free(void *table)
 {
-	struct rte_table_hash *t = (struct rte_table_hash *) table;
+	struct rte_table_hash *t = table;
 
 	/* Check input parameters */
 	if (t == NULL)
@@ -241,7 +241,7 @@ static int
 rte_table_hash_lru_entry_add(void *table, void *key, void *entry,
 	int *key_found, void **entry_ptr)
 {
-	struct rte_table_hash *t = (struct rte_table_hash *) table;
+	struct rte_table_hash *t = table;
 	struct bucket *bkt;
 	uint64_t sig;
 	uint32_t bkt_index, i;
@@ -325,7 +325,7 @@ static int
 rte_table_hash_lru_entry_delete(void *table, void *key, int *key_found,
 	void *entry)
 {
-	struct rte_table_hash *t = (struct rte_table_hash *) table;
+	struct rte_table_hash *t = table;
 	struct bucket *bkt;
 	uint64_t sig;
 	uint32_t bkt_index, i;
@@ -1068,7 +1068,7 @@ static int rte_table_hash_lru_lookup_dosig(
 static int
 rte_table_hash_lru_stats_read(void *table, struct rte_table_stats *stats, int clear)
 {
-	struct rte_table_hash *t = (struct rte_table_hash *) table;
+	struct rte_table_hash *t = table;
 
 	if (stats != NULL)
 		memcpy(stats, &t->stats, sizeof(t->stats));
diff --git a/lib/librte_table/rte_table_lpm.c b/lib/librte_table/rte_table_lpm.c
index 598b79f5f..2f472b971 100644
--- a/lib/librte_table/rte_table_lpm.c
+++ b/lib/librte_table/rte_table_lpm.c
@@ -82,7 +82,7 @@ struct rte_table_lpm {
 static void *
 rte_table_lpm_create(void *params, int socket_id, uint32_t entry_size)
 {
-	struct rte_table_lpm_params *p = (struct rte_table_lpm_params *) params;
+	struct rte_table_lpm_params *p = params;
 	struct rte_table_lpm *lpm;
 	struct rte_lpm_config lpm_config;
 
@@ -154,7 +154,7 @@ rte_table_lpm_create(void *params, int socket_id, uint32_t entry_size)
 static int
 rte_table_lpm_free(void *table)
 {
-	struct rte_table_lpm *lpm = (struct rte_table_lpm *) table;
+	struct rte_table_lpm *lpm = table;
 
 	/* Check input parameters */
 	if (lpm == NULL) {
@@ -210,8 +210,8 @@ rte_table_lpm_entry_add(
 	int *key_found,
 	void **entry_ptr)
 {
-	struct rte_table_lpm *lpm = (struct rte_table_lpm *) table;
-	struct rte_table_lpm_key *ip_prefix = (struct rte_table_lpm_key *) key;
+	struct rte_table_lpm *lpm = table;
+	struct rte_table_lpm_key *ip_prefix = key;
 	uint32_t nht_pos, nht_pos0_valid;
 	int status;
 	uint32_t nht_pos0 = 0;
@@ -277,8 +277,8 @@ rte_table_lpm_entry_delete(
 	int *key_found,
 	void *entry)
 {
-	struct rte_table_lpm *lpm = (struct rte_table_lpm *) table;
-	struct rte_table_lpm_key *ip_prefix = (struct rte_table_lpm_key *) key;
+	struct rte_table_lpm *lpm = table;
+	struct rte_table_lpm_key *ip_prefix = key;
 	uint32_t nht_pos;
 	int status;
 
@@ -372,7 +372,7 @@ rte_table_lpm_lookup(
 static int
 rte_table_lpm_stats_read(void *table, struct rte_table_stats *stats, int clear)
 {
-	struct rte_table_lpm *t = (struct rte_table_lpm *) table;
+	struct rte_table_lpm *t = table;
 
 	if (stats != NULL)
 		memcpy(stats, &t->stats, sizeof(t->stats));
diff --git a/lib/librte_table/rte_table_lpm_ipv6.c b/lib/librte_table/rte_table_lpm_ipv6.c
index 1e1a173a9..5def2ad97 100644
--- a/lib/librte_table/rte_table_lpm_ipv6.c
+++ b/lib/librte_table/rte_table_lpm_ipv6.c
@@ -81,7 +81,7 @@ static void *
 rte_table_lpm_ipv6_create(void *params, int socket_id, uint32_t entry_size)
 {
 	struct rte_table_lpm_ipv6_params *p =
-		(struct rte_table_lpm_ipv6_params *) params;
+		params;
 	struct rte_table_lpm_ipv6 *lpm;
 	struct rte_lpm6_config lpm6_config;
 	uint32_t total_size, nht_size;
@@ -152,7 +152,7 @@ rte_table_lpm_ipv6_create(void *params, int socket_id, uint32_t entry_size)
 static int
 rte_table_lpm_ipv6_free(void *table)
 {
-	struct rte_table_lpm_ipv6 *lpm = (struct rte_table_lpm_ipv6 *) table;
+	struct rte_table_lpm_ipv6 *lpm = table;
 
 	/* Check input parameters */
 	if (lpm == NULL) {
@@ -208,9 +208,9 @@ rte_table_lpm_ipv6_entry_add(
 	int *key_found,
 	void **entry_ptr)
 {
-	struct rte_table_lpm_ipv6 *lpm = (struct rte_table_lpm_ipv6 *) table;
+	struct rte_table_lpm_ipv6 *lpm = table;
 	struct rte_table_lpm_ipv6_key *ip_prefix =
-		(struct rte_table_lpm_ipv6_key *) key;
+		key;
 	uint32_t nht_pos, nht_pos0, nht_pos0_valid;
 	int status;
 
@@ -276,9 +276,9 @@ rte_table_lpm_ipv6_entry_delete(
 	int *key_found,
 	void *entry)
 {
-	struct rte_table_lpm_ipv6 *lpm = (struct rte_table_lpm_ipv6 *) table;
+	struct rte_table_lpm_ipv6 *lpm = table;
 	struct rte_table_lpm_ipv6_key *ip_prefix =
-		(struct rte_table_lpm_ipv6_key *) key;
+		key;
 	uint32_t nht_pos;
 	int status;
 
@@ -374,7 +374,7 @@ rte_table_lpm_ipv6_lookup(
 static int
 rte_table_lpm_ipv6_stats_read(void *table, struct rte_table_stats *stats, int clear)
 {
-	struct rte_table_lpm_ipv6 *t = (struct rte_table_lpm_ipv6 *) table;
+	struct rte_table_lpm_ipv6 *t = table;
 
 	if (stats != NULL)
 		memcpy(stats, &t->stats, sizeof(t->stats));
diff --git a/lib/librte_table/rte_table_stub.c b/lib/librte_table/rte_table_stub.c
index 691d681a2..1ee26bf24 100644
--- a/lib/librte_table/rte_table_stub.c
+++ b/lib/librte_table/rte_table_stub.c
@@ -98,7 +98,7 @@ rte_table_stub_lookup(
 static int
 rte_table_stub_stats_read(void *table, struct rte_table_stats *stats, int clear)
 {
-	struct rte_table_stub *t = (struct rte_table_stub *) table;
+	struct rte_table_stub *t = table;
 
 	if (stats != NULL)
 		memcpy(stats, &t->stats, sizeof(t->stats));
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 02/11] kni: remove unnecessary cast of void pointers
  2017-04-07 17:44 [PATCH 00/11] remove unnecessary cast of void pointers Stephen Hemminger
  2017-04-07 17:44 ` [PATCH 01/11] table: remove unnecessary void cast Stephen Hemminger
@ 2017-04-07 17:44 ` Stephen Hemminger
  2017-04-10  9:29   ` Ferruh Yigit
  2017-04-07 17:44 ` [PATCH 03/11] vhost: remove unnecessary cast of void pointer Stephen Hemminger
                   ` (10 subsequent siblings)
  12 siblings, 1 reply; 15+ messages in thread
From: Stephen Hemminger @ 2017-04-07 17:44 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Stephen Hemminger

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

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
---
 lib/librte_eal/linuxapp/kni/ethtool/igb/igb_ethtool.c     | 2 +-
 lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c        | 8 ++++----
 lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe_ethtool.c | 4 ++--
 lib/librte_eal/linuxapp/kni/kni_misc.c                    | 2 +-
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_ethtool.c b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_ethtool.c
index d7a987d54..95e262b78 100644
--- a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_ethtool.c
+++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_ethtool.c
@@ -1126,7 +1126,7 @@ static int igb_eeprom_test(struct igb_adapter *adapter, u64 *data)
 
 static irqreturn_t igb_test_intr(int irq, void *data)
 {
-	struct igb_adapter *adapter = (struct igb_adapter *) data;
+	struct igb_adapter *adapter = data;
 	struct e1000_hw *hw = &adapter->hw;
 
 	adapter->test_icr |= E1000_READ_REG(hw, E1000_ICR);
diff --git a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c
index f4dca5a38..c0d52db33 100644
--- a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c
+++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c
@@ -1629,7 +1629,7 @@ static void igb_check_swap_media(struct igb_adapter *adapter)
  */
 static int igb_get_i2c_data(void *data)
 {
-	struct igb_adapter *adapter = (struct igb_adapter *)data;
+	struct igb_adapter *adapter = data;
 	struct e1000_hw *hw = &adapter->hw;
 	s32 i2cctl = E1000_READ_REG(hw, E1000_I2CPARAMS);
 
@@ -1644,7 +1644,7 @@ static int igb_get_i2c_data(void *data)
  */
 static void igb_set_i2c_data(void *data, int state)
 {
-	struct igb_adapter *adapter = (struct igb_adapter *)data;
+	struct igb_adapter *adapter = data;
 	struct e1000_hw *hw = &adapter->hw;
 	s32 i2cctl = E1000_READ_REG(hw, E1000_I2CPARAMS);
 
@@ -1669,7 +1669,7 @@ static void igb_set_i2c_data(void *data, int state)
  */
 static void igb_set_i2c_clk(void *data, int state)
 {
-	struct igb_adapter *adapter = (struct igb_adapter *)data;
+	struct igb_adapter *adapter = data;
 	struct e1000_hw *hw = &adapter->hw;
 	s32 i2cctl = E1000_READ_REG(hw, E1000_I2CPARAMS);
 
@@ -1691,7 +1691,7 @@ static void igb_set_i2c_clk(void *data, int state)
  */
 static int igb_get_i2c_clk(void *data)
 {
-	struct igb_adapter *adapter = (struct igb_adapter *)data;
+	struct igb_adapter *adapter = data;
 	struct e1000_hw *hw = &adapter->hw;
 	s32 i2cctl = E1000_READ_REG(hw, E1000_I2CPARAMS);
 
diff --git a/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe_ethtool.c b/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe_ethtool.c
index bc3cb2f48..cdfcb9596 100644
--- a/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe_ethtool.c
+++ b/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe_ethtool.c
@@ -1462,7 +1462,7 @@ static int ixgbe_eeprom_test(struct ixgbe_adapter *adapter, u64 *data)
 
 static irqreturn_t ixgbe_test_intr(int irq, void *data)
 {
-	struct net_device *netdev = (struct net_device *) data;
+	struct net_device *netdev = data;
 	struct ixgbe_adapter *adapter = netdev_priv(netdev);
 
 	adapter->test_icr |= IXGBE_READ_REG(&adapter->hw, IXGBE_EICR);
@@ -2447,7 +2447,7 @@ static int ixgbe_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd,
 		break;
 	case ETHTOOL_GRXCLSRLALL:
 		ret = ixgbe_get_ethtool_fdir_all(adapter, cmd,
-						 (u32 *)rule_locs);
+						 rule_locs);
 		break;
 	case ETHTOOL_GRXFH:
 		ret = ixgbe_get_rss_hash_opts(adapter, cmd);
diff --git a/lib/librte_eal/linuxapp/kni/kni_misc.c b/lib/librte_eal/linuxapp/kni/kni_misc.c
index f1f6bea6f..818f7ce4b 100644
--- a/lib/librte_eal/linuxapp/kni/kni_misc.c
+++ b/lib/librte_eal/linuxapp/kni/kni_misc.c
@@ -159,7 +159,7 @@ static int
 kni_thread_multiple(void *param)
 {
 	int j;
-	struct kni_dev *dev = (struct kni_dev *)param;
+	struct kni_dev *dev = param;
 
 	while (!kthread_should_stop()) {
 		for (j = 0; j < KNI_RX_LOOP_NUM; j++) {
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 03/11] vhost: remove unnecessary cast of void pointer
  2017-04-07 17:44 [PATCH 00/11] remove unnecessary cast of void pointers Stephen Hemminger
  2017-04-07 17:44 ` [PATCH 01/11] table: remove unnecessary void cast Stephen Hemminger
  2017-04-07 17:44 ` [PATCH 02/11] kni: remove unnecessary cast of void pointers Stephen Hemminger
@ 2017-04-07 17:44 ` Stephen Hemminger
  2017-04-07 17:44 ` [PATCH 04/11] port: remove unnecessary cast of void pointers Stephen Hemminger
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: Stephen Hemminger @ 2017-04-07 17:44 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

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

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/librte_vhost/virtio_net.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c
index d6b7c7a22..b9f216842 100644
--- a/lib/librte_vhost/virtio_net.c
+++ b/lib/librte_vhost/virtio_net.c
@@ -629,14 +629,14 @@ parse_ethernet(struct rte_mbuf *m, uint16_t *l4_proto, void **l4_hdr)
 
 	switch (ethertype) {
 	case ETHER_TYPE_IPv4:
-		ipv4_hdr = (struct ipv4_hdr *)l3_hdr;
+		ipv4_hdr = l3_hdr;
 		*l4_proto = ipv4_hdr->next_proto_id;
 		m->l3_len = (ipv4_hdr->version_ihl & 0x0f) * 4;
 		*l4_hdr = (char *)l3_hdr + m->l3_len;
 		m->ol_flags |= PKT_TX_IPV4;
 		break;
 	case ETHER_TYPE_IPv6:
-		ipv6_hdr = (struct ipv6_hdr *)l3_hdr;
+		ipv6_hdr = l3_hdr;
 		*l4_proto = ipv6_hdr->proto;
 		m->l3_len = sizeof(struct ipv6_hdr);
 		*l4_hdr = (char *)l3_hdr + m->l3_len;
@@ -686,7 +686,7 @@ vhost_dequeue_offload(struct virtio_net_hdr *hdr, struct rte_mbuf *m)
 		switch (hdr->gso_type & ~VIRTIO_NET_HDR_GSO_ECN) {
 		case VIRTIO_NET_HDR_GSO_TCPV4:
 		case VIRTIO_NET_HDR_GSO_TCPV6:
-			tcp_hdr = (struct tcp_hdr *)l4_hdr;
+			tcp_hdr = l4_hdr;
 			m->ol_flags |= PKT_TX_TCP_SEG;
 			m->tso_segsz = hdr->gso_size;
 			m->l4_len = (tcp_hdr->data_off & 0xf0) >> 2;
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 04/11] port: remove unnecessary cast of void pointers
  2017-04-07 17:44 [PATCH 00/11] remove unnecessary cast of void pointers Stephen Hemminger
                   ` (2 preceding siblings ...)
  2017-04-07 17:44 ` [PATCH 03/11] vhost: remove unnecessary cast of void pointer Stephen Hemminger
@ 2017-04-07 17:44 ` Stephen Hemminger
  2017-04-07 17:44 ` [PATCH 05/11] crypto: remove unnecessary cast of void pointer Stephen Hemminger
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: Stephen Hemminger @ 2017-04-07 17:44 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

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

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/librte_port/rte_port_ethdev.c      | 26 +++++++++++-----------
 lib/librte_port/rte_port_fd.c          | 26 +++++++++++-----------
 lib/librte_port/rte_port_frag.c        |  6 ++---
 lib/librte_port/rte_port_kni.c         | 26 +++++++++++-----------
 lib/librte_port/rte_port_ras.c         | 12 +++++-----
 lib/librte_port/rte_port_ring.c        | 40 +++++++++++++++++-----------------
 lib/librte_port/rte_port_sched.c       | 10 ++++-----
 lib/librte_port/rte_port_source_sink.c | 20 ++++++++---------
 8 files changed, 83 insertions(+), 83 deletions(-)

diff --git a/lib/librte_port/rte_port_ethdev.c b/lib/librte_port/rte_port_ethdev.c
index 73e5f1854..7f7b16e71 100644
--- a/lib/librte_port/rte_port_ethdev.c
+++ b/lib/librte_port/rte_port_ethdev.c
@@ -67,7 +67,7 @@ static void *
 rte_port_ethdev_reader_create(void *params, int socket_id)
 {
 	struct rte_port_ethdev_reader_params *conf =
-			(struct rte_port_ethdev_reader_params *) params;
+			params;
 	struct rte_port_ethdev_reader *port;
 
 	/* Check input parameters */
@@ -95,7 +95,7 @@ static int
 rte_port_ethdev_reader_rx(void *port, struct rte_mbuf **pkts, uint32_t n_pkts)
 {
 	struct rte_port_ethdev_reader *p =
-		(struct rte_port_ethdev_reader *) port;
+		port;
 	uint16_t rx_pkt_cnt;
 
 	rx_pkt_cnt = rte_eth_rx_burst(p->port_id, p->queue_id, pkts, n_pkts);
@@ -120,7 +120,7 @@ static int rte_port_ethdev_reader_stats_read(void *port,
 		struct rte_port_in_stats *stats, int clear)
 {
 	struct rte_port_ethdev_reader *p =
-			(struct rte_port_ethdev_reader *) port;
+			port;
 
 	if (stats != NULL)
 		memcpy(stats, &p->stats, sizeof(p->stats));
@@ -163,7 +163,7 @@ static void *
 rte_port_ethdev_writer_create(void *params, int socket_id)
 {
 	struct rte_port_ethdev_writer_params *conf =
-			(struct rte_port_ethdev_writer_params *) params;
+			params;
 	struct rte_port_ethdev_writer *port;
 
 	/* Check input parameters */
@@ -212,7 +212,7 @@ static int
 rte_port_ethdev_writer_tx(void *port, struct rte_mbuf *pkt)
 {
 	struct rte_port_ethdev_writer *p =
-		(struct rte_port_ethdev_writer *) port;
+		port;
 
 	p->tx_buf[p->tx_buf_count++] = pkt;
 	RTE_PORT_ETHDEV_WRITER_STATS_PKTS_IN_ADD(p, 1);
@@ -228,7 +228,7 @@ rte_port_ethdev_writer_tx_bulk(void *port,
 		uint64_t pkts_mask)
 {
 	struct rte_port_ethdev_writer *p =
-		(struct rte_port_ethdev_writer *) port;
+		port;
 	uint64_t bsz_mask = p->bsz_mask;
 	uint32_t tx_buf_count = p->tx_buf_count;
 	uint64_t expr = (pkts_mask & (pkts_mask + 1)) |
@@ -274,7 +274,7 @@ static int
 rte_port_ethdev_writer_flush(void *port)
 {
 	struct rte_port_ethdev_writer *p =
-		(struct rte_port_ethdev_writer *) port;
+		port;
 
 	if (p->tx_buf_count > 0)
 		send_burst(p);
@@ -300,7 +300,7 @@ static int rte_port_ethdev_writer_stats_read(void *port,
 		struct rte_port_out_stats *stats, int clear)
 {
 	struct rte_port_ethdev_writer *p =
-		(struct rte_port_ethdev_writer *) port;
+		port;
 
 	if (stats != NULL)
 		memcpy(stats, &p->stats, sizeof(p->stats));
@@ -344,7 +344,7 @@ static void *
 rte_port_ethdev_writer_nodrop_create(void *params, int socket_id)
 {
 	struct rte_port_ethdev_writer_nodrop_params *conf =
-			(struct rte_port_ethdev_writer_nodrop_params *) params;
+			params;
 	struct rte_port_ethdev_writer_nodrop *port;
 
 	/* Check input parameters */
@@ -418,7 +418,7 @@ static int
 rte_port_ethdev_writer_nodrop_tx(void *port, struct rte_mbuf *pkt)
 {
 	struct rte_port_ethdev_writer_nodrop *p =
-		(struct rte_port_ethdev_writer_nodrop *) port;
+		port;
 
 	p->tx_buf[p->tx_buf_count++] = pkt;
 	RTE_PORT_ETHDEV_WRITER_NODROP_STATS_PKTS_IN_ADD(p, 1);
@@ -434,7 +434,7 @@ rte_port_ethdev_writer_nodrop_tx_bulk(void *port,
 		uint64_t pkts_mask)
 {
 	struct rte_port_ethdev_writer_nodrop *p =
-		(struct rte_port_ethdev_writer_nodrop *) port;
+		port;
 
 	uint64_t bsz_mask = p->bsz_mask;
 	uint32_t tx_buf_count = p->tx_buf_count;
@@ -487,7 +487,7 @@ static int
 rte_port_ethdev_writer_nodrop_flush(void *port)
 {
 	struct rte_port_ethdev_writer_nodrop *p =
-		(struct rte_port_ethdev_writer_nodrop *) port;
+		port;
 
 	if (p->tx_buf_count > 0)
 		send_burst_nodrop(p);
@@ -513,7 +513,7 @@ static int rte_port_ethdev_writer_nodrop_stats_read(void *port,
 		struct rte_port_out_stats *stats, int clear)
 {
 	struct rte_port_ethdev_writer_nodrop *p =
-		(struct rte_port_ethdev_writer_nodrop *) port;
+		port;
 
 	if (stats != NULL)
 		memcpy(stats, &p->stats, sizeof(p->stats));
diff --git a/lib/librte_port/rte_port_fd.c b/lib/librte_port/rte_port_fd.c
index 0d640f341..ae9f31ce0 100644
--- a/lib/librte_port/rte_port_fd.c
+++ b/lib/librte_port/rte_port_fd.c
@@ -67,7 +67,7 @@ static void *
 rte_port_fd_reader_create(void *params, int socket_id)
 {
 	struct rte_port_fd_reader_params *conf =
-			(struct rte_port_fd_reader_params *) params;
+			params;
 	struct rte_port_fd_reader *port;
 
 	/* Check input parameters */
@@ -107,7 +107,7 @@ rte_port_fd_reader_create(void *params, int socket_id)
 static int
 rte_port_fd_reader_rx(void *port, struct rte_mbuf **pkts, uint32_t n_pkts)
 {
-	struct rte_port_fd_reader *p = (struct rte_port_fd_reader *) port;
+	struct rte_port_fd_reader *p = port;
 	uint32_t i;
 
 	if (rte_mempool_get_bulk(p->mempool, (void **) pkts, n_pkts) != 0)
@@ -156,7 +156,7 @@ static int rte_port_fd_reader_stats_read(void *port,
 		struct rte_port_in_stats *stats, int clear)
 {
 	struct rte_port_fd_reader *p =
-			(struct rte_port_fd_reader *) port;
+			port;
 
 	if (stats != NULL)
 		memcpy(stats, &p->stats, sizeof(p->stats));
@@ -197,7 +197,7 @@ static void *
 rte_port_fd_writer_create(void *params, int socket_id)
 {
 	struct rte_port_fd_writer_params *conf =
-		(struct rte_port_fd_writer_params *) params;
+		params;
 	struct rte_port_fd_writer *port;
 
 	/* Check input parameters */
@@ -253,7 +253,7 @@ static int
 rte_port_fd_writer_tx(void *port, struct rte_mbuf *pkt)
 {
 	struct rte_port_fd_writer *p =
-		(struct rte_port_fd_writer *) port;
+		port;
 
 	p->tx_buf[p->tx_buf_count++] = pkt;
 	RTE_PORT_FD_WRITER_STATS_PKTS_IN_ADD(p, 1);
@@ -269,7 +269,7 @@ rte_port_fd_writer_tx_bulk(void *port,
 	uint64_t pkts_mask)
 {
 	struct rte_port_fd_writer *p =
-		(struct rte_port_fd_writer *) port;
+		port;
 	uint32_t tx_buf_count = p->tx_buf_count;
 
 	if ((pkts_mask & (pkts_mask + 1)) == 0) {
@@ -301,7 +301,7 @@ static int
 rte_port_fd_writer_flush(void *port)
 {
 	struct rte_port_fd_writer *p =
-		(struct rte_port_fd_writer *) port;
+		port;
 
 	if (p->tx_buf_count > 0)
 		send_burst(p);
@@ -327,7 +327,7 @@ static int rte_port_fd_writer_stats_read(void *port,
 		struct rte_port_out_stats *stats, int clear)
 {
 	struct rte_port_fd_writer *p =
-		(struct rte_port_fd_writer *) port;
+		port;
 
 	if (stats != NULL)
 		memcpy(stats, &p->stats, sizeof(p->stats));
@@ -369,7 +369,7 @@ static void *
 rte_port_fd_writer_nodrop_create(void *params, int socket_id)
 {
 	struct rte_port_fd_writer_nodrop_params *conf =
-			(struct rte_port_fd_writer_nodrop_params *) params;
+			params;
 	struct rte_port_fd_writer_nodrop *port;
 
 	/* Check input parameters */
@@ -438,7 +438,7 @@ static int
 rte_port_fd_writer_nodrop_tx(void *port, struct rte_mbuf *pkt)
 {
 	struct rte_port_fd_writer_nodrop *p =
-		(struct rte_port_fd_writer_nodrop *) port;
+		port;
 
 	p->tx_buf[p->tx_buf_count++] = pkt;
 	RTE_PORT_FD_WRITER_NODROP_STATS_PKTS_IN_ADD(p, 1);
@@ -454,7 +454,7 @@ rte_port_fd_writer_nodrop_tx_bulk(void *port,
 	uint64_t pkts_mask)
 {
 	struct rte_port_fd_writer_nodrop *p =
-		(struct rte_port_fd_writer_nodrop *) port;
+		port;
 	uint32_t tx_buf_count = p->tx_buf_count;
 
 	if ((pkts_mask & (pkts_mask + 1)) == 0) {
@@ -486,7 +486,7 @@ static int
 rte_port_fd_writer_nodrop_flush(void *port)
 {
 	struct rte_port_fd_writer_nodrop *p =
-		(struct rte_port_fd_writer_nodrop *) port;
+		port;
 
 	if (p->tx_buf_count > 0)
 		send_burst_nodrop(p);
@@ -512,7 +512,7 @@ static int rte_port_fd_writer_nodrop_stats_read(void *port,
 		struct rte_port_out_stats *stats, int clear)
 {
 	struct rte_port_fd_writer_nodrop *p =
-		(struct rte_port_fd_writer_nodrop *) port;
+		port;
 
 	if (stats != NULL)
 		memcpy(stats, &p->stats, sizeof(p->stats));
diff --git a/lib/librte_port/rte_port_frag.c b/lib/librte_port/rte_port_frag.c
index 320407ecb..a00c9ae15 100644
--- a/lib/librte_port/rte_port_frag.c
+++ b/lib/librte_port/rte_port_frag.c
@@ -88,7 +88,7 @@ static void *
 rte_port_ring_reader_frag_create(void *params, int socket_id, int is_ipv4)
 {
 	struct rte_port_ring_reader_frag_params *conf =
-			(struct rte_port_ring_reader_frag_params *) params;
+			params;
 	struct rte_port_ring_reader_frag *port;
 
 	/* Check input parameters */
@@ -159,7 +159,7 @@ rte_port_ring_reader_frag_rx(void *port,
 		uint32_t n_pkts)
 {
 	struct rte_port_ring_reader_frag *p =
-			(struct rte_port_ring_reader_frag *) port;
+			port;
 	uint32_t n_pkts_out;
 
 	n_pkts_out = 0;
@@ -277,7 +277,7 @@ rte_port_frag_reader_stats_read(void *port,
 		struct rte_port_in_stats *stats, int clear)
 {
 	struct rte_port_ring_reader_frag *p =
-		(struct rte_port_ring_reader_frag *) port;
+		port;
 
 	if (stats != NULL)
 		memcpy(stats, &p->stats, sizeof(p->stats));
diff --git a/lib/librte_port/rte_port_kni.c b/lib/librte_port/rte_port_kni.c
index 08f4ac2ae..2515fb2ac 100644
--- a/lib/librte_port/rte_port_kni.c
+++ b/lib/librte_port/rte_port_kni.c
@@ -66,7 +66,7 @@ static void *
 rte_port_kni_reader_create(void *params, int socket_id)
 {
 	struct rte_port_kni_reader_params *conf =
-			(struct rte_port_kni_reader_params *) params;
+			params;
 	struct rte_port_kni_reader *port;
 
 	/* Check input parameters */
@@ -93,7 +93,7 @@ static int
 rte_port_kni_reader_rx(void *port, struct rte_mbuf **pkts, uint32_t n_pkts)
 {
 	struct rte_port_kni_reader *p =
-			(struct rte_port_kni_reader *) port;
+			port;
 	uint16_t rx_pkt_cnt;
 
 	rx_pkt_cnt = rte_kni_rx_burst(p->kni, pkts, n_pkts);
@@ -118,7 +118,7 @@ static int rte_port_kni_reader_stats_read(void *port,
 	struct rte_port_in_stats *stats, int clear)
 {
 	struct rte_port_kni_reader *p =
-			(struct rte_port_kni_reader *) port;
+			port;
 
 	if (stats != NULL)
 		memcpy(stats, &p->stats, sizeof(p->stats));
@@ -160,7 +160,7 @@ static void *
 rte_port_kni_writer_create(void *params, int socket_id)
 {
 	struct rte_port_kni_writer_params *conf =
-			(struct rte_port_kni_writer_params *) params;
+			params;
 	struct rte_port_kni_writer *port;
 
 	/* Check input parameters */
@@ -207,7 +207,7 @@ static int
 rte_port_kni_writer_tx(void *port, struct rte_mbuf *pkt)
 {
 	struct rte_port_kni_writer *p =
-			(struct rte_port_kni_writer *) port;
+			port;
 
 	p->tx_buf[p->tx_buf_count++] = pkt;
 	RTE_PORT_KNI_WRITER_STATS_PKTS_IN_ADD(p, 1);
@@ -223,7 +223,7 @@ rte_port_kni_writer_tx_bulk(void *port,
 	uint64_t pkts_mask)
 {
 	struct rte_port_kni_writer *p =
-			(struct rte_port_kni_writer *) port;
+			port;
 	uint64_t bsz_mask = p->bsz_mask;
 	uint32_t tx_buf_count = p->tx_buf_count;
 	uint64_t expr = (pkts_mask & (pkts_mask + 1)) |
@@ -268,7 +268,7 @@ static int
 rte_port_kni_writer_flush(void *port)
 {
 	struct rte_port_kni_writer *p =
-			(struct rte_port_kni_writer *) port;
+			port;
 
 	if (p->tx_buf_count > 0)
 		send_burst(p);
@@ -294,7 +294,7 @@ static int rte_port_kni_writer_stats_read(void *port,
 	struct rte_port_out_stats *stats, int clear)
 {
 	struct rte_port_kni_writer *p =
-			(struct rte_port_kni_writer *) port;
+			port;
 
 	if (stats != NULL)
 		memcpy(stats, &p->stats, sizeof(p->stats));
@@ -337,7 +337,7 @@ static void *
 rte_port_kni_writer_nodrop_create(void *params, int socket_id)
 {
 	struct rte_port_kni_writer_nodrop_params *conf =
-		(struct rte_port_kni_writer_nodrop_params *) params;
+		params;
 	struct rte_port_kni_writer_nodrop *port;
 
 	/* Check input parameters */
@@ -410,7 +410,7 @@ static int
 rte_port_kni_writer_nodrop_tx(void *port, struct rte_mbuf *pkt)
 {
 	struct rte_port_kni_writer_nodrop *p =
-			(struct rte_port_kni_writer_nodrop *) port;
+			port;
 
 	p->tx_buf[p->tx_buf_count++] = pkt;
 	RTE_PORT_KNI_WRITER_STATS_PKTS_IN_ADD(p, 1);
@@ -426,7 +426,7 @@ rte_port_kni_writer_nodrop_tx_bulk(void *port,
 	uint64_t pkts_mask)
 {
 	struct rte_port_kni_writer_nodrop *p =
-			(struct rte_port_kni_writer_nodrop *) port;
+			port;
 
 	uint64_t bsz_mask = p->bsz_mask;
 	uint32_t tx_buf_count = p->tx_buf_count;
@@ -478,7 +478,7 @@ static int
 rte_port_kni_writer_nodrop_flush(void *port)
 {
 	struct rte_port_kni_writer_nodrop *p =
-		(struct rte_port_kni_writer_nodrop *) port;
+		port;
 
 	if (p->tx_buf_count > 0)
 		send_burst_nodrop(p);
@@ -504,7 +504,7 @@ static int rte_port_kni_writer_nodrop_stats_read(void *port,
 	struct rte_port_out_stats *stats, int clear)
 {
 	struct rte_port_kni_writer_nodrop *p =
-			(struct rte_port_kni_writer_nodrop *) port;
+			port;
 
 	if (stats != NULL)
 		memcpy(stats, &p->stats, sizeof(p->stats));
diff --git a/lib/librte_port/rte_port_ras.c b/lib/librte_port/rte_port_ras.c
index 4de0945ea..415fadd5b 100644
--- a/lib/librte_port/rte_port_ras.c
+++ b/lib/librte_port/rte_port_ras.c
@@ -93,7 +93,7 @@ static void *
 rte_port_ring_writer_ras_create(void *params, int socket_id, int is_ipv4)
 {
 	struct rte_port_ring_writer_ras_params *conf =
-			(struct rte_port_ring_writer_ras_params *) params;
+			params;
 	struct rte_port_ring_writer_ras *port;
 	uint64_t frag_cycles;
 
@@ -243,7 +243,7 @@ static int
 rte_port_ring_writer_ras_tx(void *port, struct rte_mbuf *pkt)
 {
 	struct rte_port_ring_writer_ras *p =
-			(struct rte_port_ring_writer_ras *) port;
+			port;
 
 	RTE_PORT_RING_WRITER_RAS_STATS_PKTS_IN_ADD(p, 1);
 	p->f_ras(p, pkt);
@@ -259,7 +259,7 @@ rte_port_ring_writer_ras_tx_bulk(void *port,
 		uint64_t pkts_mask)
 {
 	struct rte_port_ring_writer_ras *p =
-			(struct rte_port_ring_writer_ras *) port;
+			port;
 
 	if ((pkts_mask & (pkts_mask + 1)) == 0) {
 		uint64_t n_pkts = __builtin_popcountll(pkts_mask);
@@ -295,7 +295,7 @@ static int
 rte_port_ring_writer_ras_flush(void *port)
 {
 	struct rte_port_ring_writer_ras *p =
-			(struct rte_port_ring_writer_ras *) port;
+			port;
 
 	if (p->tx_buf_count > 0)
 		send_burst(p);
@@ -307,7 +307,7 @@ static int
 rte_port_ring_writer_ras_free(void *port)
 {
 	struct rte_port_ring_writer_ras *p =
-			(struct rte_port_ring_writer_ras *) port;
+			port;
 
 	if (port == NULL) {
 		RTE_LOG(ERR, PORT, "%s: Parameter port is NULL\n", __func__);
@@ -326,7 +326,7 @@ rte_port_ras_writer_stats_read(void *port,
 		struct rte_port_out_stats *stats, int clear)
 {
 	struct rte_port_ring_writer_ras *p =
-		(struct rte_port_ring_writer_ras *) port;
+		port;
 
 	if (stats != NULL)
 		memcpy(stats, &p->stats, sizeof(p->stats));
diff --git a/lib/librte_port/rte_port_ring.c b/lib/librte_port/rte_port_ring.c
index 85fad4456..64bd965f5 100644
--- a/lib/librte_port/rte_port_ring.c
+++ b/lib/librte_port/rte_port_ring.c
@@ -67,7 +67,7 @@ rte_port_ring_reader_create_internal(void *params, int socket_id,
 	uint32_t is_multi)
 {
 	struct rte_port_ring_reader_params *conf =
-			(struct rte_port_ring_reader_params *) params;
+			params;
 	struct rte_port_ring_reader *port;
 
 	/* Check input parameters */
@@ -108,7 +108,7 @@ rte_port_ring_multi_reader_create(void *params, int socket_id)
 static int
 rte_port_ring_reader_rx(void *port, struct rte_mbuf **pkts, uint32_t n_pkts)
 {
-	struct rte_port_ring_reader *p = (struct rte_port_ring_reader *) port;
+	struct rte_port_ring_reader *p = port;
 	uint32_t nb_rx;
 
 	nb_rx = rte_ring_sc_dequeue_burst(p->ring, (void **) pkts,
@@ -122,7 +122,7 @@ static int
 rte_port_ring_multi_reader_rx(void *port, struct rte_mbuf **pkts,
 	uint32_t n_pkts)
 {
-	struct rte_port_ring_reader *p = (struct rte_port_ring_reader *) port;
+	struct rte_port_ring_reader *p = port;
 	uint32_t nb_rx;
 
 	nb_rx = rte_ring_mc_dequeue_burst(p->ring, (void **) pkts,
@@ -150,7 +150,7 @@ rte_port_ring_reader_stats_read(void *port,
 		struct rte_port_in_stats *stats, int clear)
 {
 	struct rte_port_ring_reader *p =
-		(struct rte_port_ring_reader *) port;
+		port;
 
 	if (stats != NULL)
 		memcpy(stats, &p->stats, sizeof(p->stats));
@@ -194,7 +194,7 @@ rte_port_ring_writer_create_internal(void *params, int socket_id,
 	uint32_t is_multi)
 {
 	struct rte_port_ring_writer_params *conf =
-			(struct rte_port_ring_writer_params *) params;
+			params;
 	struct rte_port_ring_writer *port;
 
 	/* Check input parameters */
@@ -270,7 +270,7 @@ send_burst_mp(struct rte_port_ring_writer *p)
 static int
 rte_port_ring_writer_tx(void *port, struct rte_mbuf *pkt)
 {
-	struct rte_port_ring_writer *p = (struct rte_port_ring_writer *) port;
+	struct rte_port_ring_writer *p = port;
 
 	p->tx_buf[p->tx_buf_count++] = pkt;
 	RTE_PORT_RING_WRITER_STATS_PKTS_IN_ADD(p, 1);
@@ -283,7 +283,7 @@ rte_port_ring_writer_tx(void *port, struct rte_mbuf *pkt)
 static int
 rte_port_ring_multi_writer_tx(void *port, struct rte_mbuf *pkt)
 {
-	struct rte_port_ring_writer *p = (struct rte_port_ring_writer *) port;
+	struct rte_port_ring_writer *p = port;
 
 	p->tx_buf[p->tx_buf_count++] = pkt;
 	RTE_PORT_RING_WRITER_STATS_PKTS_IN_ADD(p, 1);
@@ -300,7 +300,7 @@ rte_port_ring_writer_tx_bulk_internal(void *port,
 		uint32_t is_multi)
 {
 	struct rte_port_ring_writer *p =
-		(struct rte_port_ring_writer *) port;
+		port;
 
 	uint64_t bsz_mask = p->bsz_mask;
 	uint32_t tx_buf_count = p->tx_buf_count;
@@ -374,7 +374,7 @@ rte_port_ring_multi_writer_tx_bulk(void *port,
 static int
 rte_port_ring_writer_flush(void *port)
 {
-	struct rte_port_ring_writer *p = (struct rte_port_ring_writer *) port;
+	struct rte_port_ring_writer *p = port;
 
 	if (p->tx_buf_count > 0)
 		send_burst(p);
@@ -385,7 +385,7 @@ rte_port_ring_writer_flush(void *port)
 static int
 rte_port_ring_multi_writer_flush(void *port)
 {
-	struct rte_port_ring_writer *p = (struct rte_port_ring_writer *) port;
+	struct rte_port_ring_writer *p = port;
 
 	if (p->tx_buf_count > 0)
 		send_burst_mp(p);
@@ -396,7 +396,7 @@ rte_port_ring_multi_writer_flush(void *port)
 static int
 rte_port_ring_writer_free(void *port)
 {
-	struct rte_port_ring_writer *p = (struct rte_port_ring_writer *) port;
+	struct rte_port_ring_writer *p = port;
 
 	if (port == NULL) {
 		RTE_LOG(ERR, PORT, "%s: Port is NULL\n", __func__);
@@ -418,7 +418,7 @@ rte_port_ring_writer_stats_read(void *port,
 		struct rte_port_out_stats *stats, int clear)
 {
 	struct rte_port_ring_writer *p =
-		(struct rte_port_ring_writer *) port;
+		port;
 
 	if (stats != NULL)
 		memcpy(stats, &p->stats, sizeof(p->stats));
@@ -463,7 +463,7 @@ rte_port_ring_writer_nodrop_create_internal(void *params, int socket_id,
 	uint32_t is_multi)
 {
 	struct rte_port_ring_writer_nodrop_params *conf =
-			(struct rte_port_ring_writer_nodrop_params *) params;
+			params;
 	struct rte_port_ring_writer_nodrop *port;
 
 	/* Check input parameters */
@@ -585,7 +585,7 @@ static int
 rte_port_ring_writer_nodrop_tx(void *port, struct rte_mbuf *pkt)
 {
 	struct rte_port_ring_writer_nodrop *p =
-			(struct rte_port_ring_writer_nodrop *) port;
+			port;
 
 	p->tx_buf[p->tx_buf_count++] = pkt;
 	RTE_PORT_RING_WRITER_NODROP_STATS_PKTS_IN_ADD(p, 1);
@@ -599,7 +599,7 @@ static int
 rte_port_ring_multi_writer_nodrop_tx(void *port, struct rte_mbuf *pkt)
 {
 	struct rte_port_ring_writer_nodrop *p =
-			(struct rte_port_ring_writer_nodrop *) port;
+			port;
 
 	p->tx_buf[p->tx_buf_count++] = pkt;
 	RTE_PORT_RING_WRITER_NODROP_STATS_PKTS_IN_ADD(p, 1);
@@ -616,7 +616,7 @@ rte_port_ring_writer_nodrop_tx_bulk_internal(void *port,
 		uint32_t is_multi)
 {
 	struct rte_port_ring_writer_nodrop *p =
-		(struct rte_port_ring_writer_nodrop *) port;
+		port;
 
 	uint64_t bsz_mask = p->bsz_mask;
 	uint32_t tx_buf_count = p->tx_buf_count;
@@ -705,7 +705,7 @@ static int
 rte_port_ring_writer_nodrop_flush(void *port)
 {
 	struct rte_port_ring_writer_nodrop *p =
-			(struct rte_port_ring_writer_nodrop *) port;
+			port;
 
 	if (p->tx_buf_count > 0)
 		send_burst_nodrop(p);
@@ -717,7 +717,7 @@ static int
 rte_port_ring_multi_writer_nodrop_flush(void *port)
 {
 	struct rte_port_ring_writer_nodrop *p =
-			(struct rte_port_ring_writer_nodrop *) port;
+			port;
 
 	if (p->tx_buf_count > 0)
 		send_burst_mp_nodrop(p);
@@ -729,7 +729,7 @@ static int
 rte_port_ring_writer_nodrop_free(void *port)
 {
 	struct rte_port_ring_writer_nodrop *p =
-			(struct rte_port_ring_writer_nodrop *) port;
+			port;
 
 	if (port == NULL) {
 		RTE_LOG(ERR, PORT, "%s: Port is NULL\n", __func__);
@@ -751,7 +751,7 @@ rte_port_ring_writer_nodrop_stats_read(void *port,
 		struct rte_port_out_stats *stats, int clear)
 {
 	struct rte_port_ring_writer_nodrop *p =
-		(struct rte_port_ring_writer_nodrop *) port;
+		port;
 
 	if (stats != NULL)
 		memcpy(stats, &p->stats, sizeof(p->stats));
diff --git a/lib/librte_port/rte_port_sched.c b/lib/librte_port/rte_port_sched.c
index 25217d625..9100a197c 100644
--- a/lib/librte_port/rte_port_sched.c
+++ b/lib/librte_port/rte_port_sched.c
@@ -64,7 +64,7 @@ static void *
 rte_port_sched_reader_create(void *params, int socket_id)
 {
 	struct rte_port_sched_reader_params *conf =
-			(struct rte_port_sched_reader_params *) params;
+			params;
 	struct rte_port_sched_reader *port;
 
 	/* Check input parameters */
@@ -91,7 +91,7 @@ rte_port_sched_reader_create(void *params, int socket_id)
 static int
 rte_port_sched_reader_rx(void *port, struct rte_mbuf **pkts, uint32_t n_pkts)
 {
-	struct rte_port_sched_reader *p = (struct rte_port_sched_reader *) port;
+	struct rte_port_sched_reader *p = port;
 	uint32_t nb_rx;
 
 	nb_rx = rte_sched_port_dequeue(p->sched, pkts, n_pkts);
@@ -118,7 +118,7 @@ rte_port_sched_reader_stats_read(void *port,
 		struct rte_port_in_stats *stats, int clear)
 {
 	struct rte_port_sched_reader *p =
-		(struct rte_port_sched_reader *) port;
+		port;
 
 	if (stats != NULL)
 		memcpy(stats, &p->stats, sizeof(p->stats));
@@ -160,7 +160,7 @@ static void *
 rte_port_sched_writer_create(void *params, int socket_id)
 {
 	struct rte_port_sched_writer_params *conf =
-			(struct rte_port_sched_writer_params *) params;
+			params;
 	struct rte_port_sched_writer *port;
 
 	/* Check input parameters */
@@ -292,7 +292,7 @@ rte_port_sched_writer_stats_read(void *port,
 		struct rte_port_out_stats *stats, int clear)
 {
 	struct rte_port_sched_writer *p =
-		(struct rte_port_sched_writer *) port;
+		port;
 
 	if (stats != NULL)
 		memcpy(stats, &p->stats, sizeof(p->stats));
diff --git a/lib/librte_port/rte_port_source_sink.c b/lib/librte_port/rte_port_source_sink.c
index 4cad71097..851916c1a 100644
--- a/lib/librte_port/rte_port_source_sink.c
+++ b/lib/librte_port/rte_port_source_sink.c
@@ -228,7 +228,7 @@ static void *
 rte_port_source_create(void *params, int socket_id)
 {
 	struct rte_port_source_params *p =
-			(struct rte_port_source_params *) params;
+			params;
 	struct rte_port_source *port;
 
 	/* Check input arguments*/
@@ -265,7 +265,7 @@ static int
 rte_port_source_free(void *port)
 {
 	struct rte_port_source *p =
-			(struct rte_port_source *)port;
+			port;
 
 	/* Check input parameters */
 	if (p == NULL)
@@ -286,7 +286,7 @@ rte_port_source_free(void *port)
 static int
 rte_port_source_rx(void *port, struct rte_mbuf **pkts, uint32_t n_pkts)
 {
-	struct rte_port_source *p = (struct rte_port_source *) port;
+	struct rte_port_source *p = port;
 	uint32_t i;
 
 	if (rte_mempool_get_bulk(p->mempool, (void **) pkts, n_pkts) != 0)
@@ -323,7 +323,7 @@ rte_port_source_stats_read(void *port,
 		struct rte_port_in_stats *stats, int clear)
 {
 	struct rte_port_source *p =
-		(struct rte_port_source *) port;
+		port;
 
 	if (stats != NULL)
 		memcpy(stats, &p->stats, sizeof(p->stats));
@@ -400,7 +400,7 @@ pcap_sink_open(struct rte_port_sink *port,
 static void
 pcap_sink_write_pkt(struct rte_port_sink *port, struct rte_mbuf *mbuf)
 {
-	uint8_t *pcap_dumper = (uint8_t *)(port->dumper);
+	uint8_t *pcap_dumper = (port->dumper);
 	struct pcap_pkthdr pcap_hdr;
 	uint8_t jumbo_pkt_buf[ETHER_MAX_JUMBO_FRAME_LEN];
 	uint8_t *pkt;
@@ -524,7 +524,7 @@ rte_port_sink_create(void *params, int socket_id)
 static int
 rte_port_sink_tx(void *port, struct rte_mbuf *pkt)
 {
-	struct rte_port_sink *p = (struct rte_port_sink *) port;
+	struct rte_port_sink *p = port;
 
 	RTE_PORT_SINK_STATS_PKTS_IN_ADD(p, 1);
 	if (p->dumper != NULL)
@@ -539,7 +539,7 @@ static int
 rte_port_sink_tx_bulk(void *port, struct rte_mbuf **pkts,
 	uint64_t pkts_mask)
 {
-	struct rte_port_sink *p = (struct rte_port_sink *) port;
+	struct rte_port_sink *p = port;
 
 	if ((pkts_mask & (pkts_mask + 1)) == 0) {
 		uint64_t n_pkts = __builtin_popcountll(pkts_mask);
@@ -591,7 +591,7 @@ static int
 rte_port_sink_flush(void *port)
 {
 	struct rte_port_sink *p =
-			(struct rte_port_sink *)port;
+			port;
 
 	if (p == NULL)
 		return 0;
@@ -605,7 +605,7 @@ static int
 rte_port_sink_free(void *port)
 {
 	struct rte_port_sink *p =
-			(struct rte_port_sink *)port;
+			port;
 
 	if (p == NULL)
 		return 0;
@@ -622,7 +622,7 @@ rte_port_sink_stats_read(void *port, struct rte_port_out_stats *stats,
 		int clear)
 {
 	struct rte_port_sink *p =
-		(struct rte_port_sink *) port;
+		port;
 
 	if (stats != NULL)
 		memcpy(stats, &p->stats, sizeof(p->stats));
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 05/11] crypto: remove unnecessary cast of void pointer
  2017-04-07 17:44 [PATCH 00/11] remove unnecessary cast of void pointers Stephen Hemminger
                   ` (3 preceding siblings ...)
  2017-04-07 17:44 ` [PATCH 04/11] port: remove unnecessary cast of void pointers Stephen Hemminger
@ 2017-04-07 17:44 ` Stephen Hemminger
  2017-04-07 17:44 ` [PATCH 06/11] acl: " Stephen Hemminger
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: Stephen Hemminger @ 2017-04-07 17:44 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

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

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/librte_cryptodev/rte_cryptodev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c
index 30fd86e49..6f5080c0c 100644
--- a/lib/librte_cryptodev/rte_cryptodev.c
+++ b/lib/librte_cryptodev/rte_cryptodev.c
@@ -254,7 +254,7 @@ static int
 parse_integer_arg(const char *key __rte_unused,
 		const char *value, void *extra_args)
 {
-	int *i = (int *) extra_args;
+	int *i = extra_args;
 
 	*i = atoi(value);
 	if (*i < 0) {
@@ -1383,7 +1383,7 @@ rte_cryptodev_sym_session_create(uint8_t dev_id,
 		return NULL;
 	}
 
-	sess = (struct rte_cryptodev_sym_session *)_sess;
+	sess = _sess;
 
 	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->session_configure, NULL);
 	if (dev->dev_ops->session_configure(dev, xform, sess->_private) ==
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 06/11] acl: remove unnecessary cast of void pointer
  2017-04-07 17:44 [PATCH 00/11] remove unnecessary cast of void pointers Stephen Hemminger
                   ` (4 preceding siblings ...)
  2017-04-07 17:44 ` [PATCH 05/11] crypto: remove unnecessary cast of void pointer Stephen Hemminger
@ 2017-04-07 17:44 ` Stephen Hemminger
  2017-04-07 17:44 ` [PATCH 07/11] eal: " Stephen Hemminger
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: Stephen Hemminger @ 2017-04-07 17:44 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

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

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/librte_acl/acl_bld.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/librte_acl/acl_bld.c b/lib/librte_acl/acl_bld.c
index 9e5ad1c63..0768cd3bf 100644
--- a/lib/librte_acl/acl_bld.c
+++ b/lib/librte_acl/acl_bld.c
@@ -830,8 +830,8 @@ acl_gen_range_trie(struct acl_build_context *context,
 {
 	int32_t n;
 	struct rte_acl_node *root;
-	const uint8_t *lo = (const uint8_t *)min;
-	const uint8_t *hi = (const uint8_t *)max;
+	const uint8_t *lo = min;
+	const uint8_t *hi = max;
 
 	*pend = acl_alloc_node(context, level+size);
 	root = acl_alloc_node(context, level++);
@@ -886,8 +886,8 @@ acl_gen_mask_trie(struct acl_build_context *context,
 	struct rte_acl_node *root;
 	struct rte_acl_node *node, *prev;
 	struct rte_acl_bitset bits;
-	const uint8_t *val = (const uint8_t *)value;
-	const uint8_t *msk = (const uint8_t *)mask;
+	const uint8_t *val = value;
+	const uint8_t *msk = mask;
 
 	root = acl_alloc_node(context, level++);
 	prev = root;
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 07/11] eal: remove unnecessary cast of void pointer
  2017-04-07 17:44 [PATCH 00/11] remove unnecessary cast of void pointers Stephen Hemminger
                   ` (5 preceding siblings ...)
  2017-04-07 17:44 ` [PATCH 06/11] acl: " Stephen Hemminger
@ 2017-04-07 17:44 ` Stephen Hemminger
  2017-04-07 17:44 ` [PATCH 08/11] net: remmove " Stephen Hemminger
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: Stephen Hemminger @ 2017-04-07 17:44 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

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

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 08/11] net: remmove unnecessary cast of void pointer
  2017-04-07 17:44 [PATCH 00/11] remove unnecessary cast of void pointers Stephen Hemminger
                   ` (6 preceding siblings ...)
  2017-04-07 17:44 ` [PATCH 07/11] eal: " Stephen Hemminger
@ 2017-04-07 17:44 ` Stephen Hemminger
  2017-04-07 17:44 ` [PATCH 09/11] ether: remove " Stephen Hemminger
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: Stephen Hemminger @ 2017-04-07 17:44 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

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

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/librte_net/rte_net_crc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_net/rte_net_crc.c b/lib/librte_net/rte_net_crc.c
index 72efe2026..e8326fe76 100644
--- a/lib/librte_net/rte_net_crc.c
+++ b/lib/librte_net/rte_net_crc.c
@@ -185,7 +185,7 @@ rte_net_crc_calc(const void *data,
 	rte_net_crc_handler f_handle;
 
 	f_handle = handlers[type];
-	ret = f_handle((const uint8_t *) data, data_len);
+	ret = f_handle(data, data_len);
 
 	return ret;
 }
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 09/11] ether: remove unnecessary cast of void pointer
  2017-04-07 17:44 [PATCH 00/11] remove unnecessary cast of void pointers Stephen Hemminger
                   ` (7 preceding siblings ...)
  2017-04-07 17:44 ` [PATCH 08/11] net: remmove " Stephen Hemminger
@ 2017-04-07 17:44 ` Stephen Hemminger
  2017-04-07 17:44 ` [PATCH 10/11] mempool: " Stephen Hemminger
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: Stephen Hemminger @ 2017-04-07 17:44 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

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

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/librte_ether/rte_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index 4e1e6dc17..fa6ae4412 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -2527,7 +2527,7 @@ _rte_eth_dev_callback_process(struct rte_eth_dev *dev,
 		dev_cb = *cb_lst;
 		cb_lst->active = 1;
 		if (cb_arg != NULL)
-			dev_cb.cb_arg = (void *) cb_arg;
+			dev_cb.cb_arg = cb_arg;
 
 		rte_spinlock_unlock(&rte_eth_dev_cb_lock);
 		dev_cb.cb_fn(dev->data->port_id, dev_cb.event,
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 10/11] mempool: remove unnecessary cast of void pointer
  2017-04-07 17:44 [PATCH 00/11] remove unnecessary cast of void pointers Stephen Hemminger
                   ` (8 preceding siblings ...)
  2017-04-07 17:44 ` [PATCH 09/11] ether: remove " Stephen Hemminger
@ 2017-04-07 17:44 ` Stephen Hemminger
  2017-04-07 17:44 ` [PATCH 11/11] test: " Stephen Hemminger
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 15+ messages in thread
From: Stephen Hemminger @ 2017-04-07 17:44 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

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

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/librte_mempool/rte_mempool.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c
index ef7d3d15b..f65310f60 100644
--- a/lib/librte_mempool/rte_mempool.c
+++ b/lib/librte_mempool/rte_mempool.c
@@ -1044,7 +1044,7 @@ void rte_mempool_check_cookies(const struct rte_mempool *mp,
 	/* Force to drop the "const" attribute. This is done only when
 	 * DEBUG is enabled */
 	tmp = (void *) obj_table_const;
-	obj_table = (void **) tmp;
+	obj_table = tmp;
 
 	while (n--) {
 		obj = obj_table[n];
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [PATCH 11/11] test: remove unnecessary cast of void pointer
  2017-04-07 17:44 [PATCH 00/11] remove unnecessary cast of void pointers Stephen Hemminger
                   ` (9 preceding siblings ...)
  2017-04-07 17:44 ` [PATCH 10/11] mempool: " Stephen Hemminger
@ 2017-04-07 17:44 ` Stephen Hemminger
  2017-04-08 19:42 ` [PATCH 00/11] remove unnecessary cast of void pointers Thomas Monjalon
  2017-04-11 16:06 ` Thomas Monjalon
  12 siblings, 0 replies; 15+ messages in thread
From: Stephen Hemminger @ 2017-04-07 17:44 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

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

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 test/test-pipeline/pipeline_hash.c | 2 +-
 test/test/test_efd.c               | 2 +-
 test/test/test_interrupts.c        | 4 ++--
 test/test/test_mbuf.c              | 2 +-
 test/test/test_table.c             | 2 +-
 test/test/test_table_acl.c         | 2 +-
 test/test/test_table_pipeline.c    | 2 +-
 test/test/virtual_pmd.c            | 4 ++--
 8 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/test/test-pipeline/pipeline_hash.c b/test/test-pipeline/pipeline_hash.c
index 0c6e04f78..991e381e2 100644
--- a/test/test-pipeline/pipeline_hash.c
+++ b/test/test-pipeline/pipeline_hash.c
@@ -480,7 +480,7 @@ uint64_t test_hash(
 	__attribute__((unused)) uint32_t key_size,
 	__attribute__((unused)) uint64_t seed)
 {
-	uint32_t *k32 = (uint32_t *) key;
+	uint32_t *k32 = key;
 	uint32_t ip_dst = rte_be_to_cpu_32(k32[0]);
 	uint64_t signature = (ip_dst >> 2) | ((ip_dst & 0x3) << 30);
 
diff --git a/test/test/test_efd.c b/test/test/test_efd.c
index de49e1d7e..544306166 100644
--- a/test/test/test_efd.c
+++ b/test/test/test_efd.c
@@ -306,7 +306,7 @@ static int test_five_keys(void)
 		key_array[i] = &keys[i];
 
 	rte_efd_lookup_bulk(handle, test_socket_id, 5,
-			(const void **) (void *) &key_array, result);
+			(void *) &key_array, result);
 
 	for (i = 0; i < 5; i++) {
 		TEST_ASSERT_EQUAL(result[i], data[i],
diff --git a/test/test/test_interrupts.c b/test/test/test_interrupts.c
index 5377292b5..e0229e5ee 100644
--- a/test/test/test_interrupts.c
+++ b/test/test/test_interrupts.c
@@ -201,7 +201,7 @@ test_interrupt_handle_compare(struct rte_intr_handle *intr_handle_l,
 static void
 test_interrupt_callback(void *arg)
 {
-	struct rte_intr_handle *intr_handle = (struct rte_intr_handle *)arg;
+	struct rte_intr_handle *intr_handle = arg;
 	if (test_intr_type >= TEST_INTERRUPT_HANDLE_MAX) {
 		printf("invalid interrupt type\n");
 		flag = -1;
@@ -233,7 +233,7 @@ test_interrupt_callback(void *arg)
 static void
 test_interrupt_callback_1(void *arg)
 {
-	struct rte_intr_handle *intr_handle = (struct rte_intr_handle *)arg;
+	struct rte_intr_handle *intr_handle = arg;
 	if (test_interrupt_handle_sanity_check(intr_handle) < 0) {
 		printf("null or invalid intr_handle for %s\n", __func__);
 		flag = -1;
diff --git a/test/test/test_mbuf.c b/test/test/test_mbuf.c
index a2e9bc6cf..d3ea812e5 100644
--- a/test/test/test_mbuf.c
+++ b/test/test/test_mbuf.c
@@ -692,7 +692,7 @@ test_refcnt_slave(__attribute__((unused)) void *arg)
 	while (refcnt_stop_slaves == 0) {
 		if (rte_ring_dequeue(refcnt_mbuf_ring, &mp) == 0) {
 			free++;
-			rte_pktmbuf_free((struct rte_mbuf *)mp);
+			rte_pktmbuf_free(mp);
 		}
 	}
 
diff --git a/test/test/test_table.c b/test/test/test_table.c
index 1faa0a6d8..9e9eed886 100644
--- a/test/test/test_table.c
+++ b/test/test/test_table.c
@@ -75,7 +75,7 @@ uint64_t pipeline_test_hash(void *key,
 		__attribute__((unused)) uint32_t key_size,
 		__attribute__((unused)) uint64_t seed)
 {
-	uint32_t *k32 = (uint32_t *) key;
+	uint32_t *k32 = key;
 	uint32_t ip_dst = rte_be_to_cpu_32(k32[0]);
 	uint64_t signature = ip_dst;
 
diff --git a/test/test/test_table_acl.c b/test/test/test_table_acl.c
index 4d43be7bc..08c100ffa 100644
--- a/test/test/test_table_acl.c
+++ b/test/test/test_table_acl.c
@@ -720,7 +720,7 @@ test_pipeline_single_filter(int expected_count)
 		} else {
 			printf("Got %d object(s) from ring %d!\n", ret, i);
 			for (j = 0; j < ret; j++) {
-				mbuf = (struct rte_mbuf *)objs[j];
+				mbuf = objs[j];
 				rte_hexdump(stdout, "mbuf",
 					rte_pktmbuf_mtod(mbuf, char *), 64);
 				rte_pktmbuf_free(mbuf);
diff --git a/test/test/test_table_pipeline.c b/test/test/test_table_pipeline.c
index b58aa5d12..a6fef721d 100644
--- a/test/test/test_table_pipeline.c
+++ b/test/test/test_table_pipeline.c
@@ -501,7 +501,7 @@ test_pipeline_single_filter(int test_type, int expected_count)
 		else {
 			printf("Got %d object(s) from ring %d!\n", ret, i);
 			for (j = 0; j < ret; j++) {
-				mbuf = (struct rte_mbuf *)objs[j];
+				mbuf = objs[j];
 				rte_hexdump(stdout, "Object:",
 					rte_pktmbuf_mtod(mbuf, char *),
 					mbuf->data_len);
diff --git a/test/test/virtual_pmd.c b/test/test/virtual_pmd.c
index b209355af..b8802cd6a 100644
--- a/test/test/virtual_pmd.c
+++ b/test/test/virtual_pmd.c
@@ -366,7 +366,7 @@ static uint16_t
 virtual_ethdev_tx_burst_success(void *queue, struct rte_mbuf **bufs,
 		uint16_t nb_pkts)
 {
-	struct virtual_ethdev_queue *tx_q = (struct virtual_ethdev_queue *)queue;
+	struct virtual_ethdev_queue *tx_q = queue;
 
 	struct rte_eth_dev *vrtl_eth_dev;
 	struct virtual_ethdev_private *dev_private;
@@ -402,7 +402,7 @@ virtual_ethdev_tx_burst_fail(void *queue, struct rte_mbuf **bufs,
 
 	int i;
 
-	tx_q = (struct virtual_ethdev_queue *)queue;
+	tx_q = queue;
 	vrtl_eth_dev = &rte_eth_devices[tx_q->port_id];
 	dev_private = vrtl_eth_dev->data->dev_private;
 
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 15+ messages in thread

* Re: [PATCH 00/11] remove unnecessary cast of void pointers
  2017-04-07 17:44 [PATCH 00/11] remove unnecessary cast of void pointers Stephen Hemminger
                   ` (10 preceding siblings ...)
  2017-04-07 17:44 ` [PATCH 11/11] test: " Stephen Hemminger
@ 2017-04-08 19:42 ` Thomas Monjalon
  2017-04-11 16:06 ` Thomas Monjalon
  12 siblings, 0 replies; 15+ messages in thread
From: Thomas Monjalon @ 2017-04-08 19:42 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: dev

2017-04-07 13:44, Stephen Hemminger:
> This is a set patches inspired by a set of Linux kernel patches
> by simran singhal <singhalsimran0@gmail.com>
> 
> The following Coccinelle script was used to detect this:
> @r@
> expression x;
> void* e;
> type T;
> identifier f;
> @@
> (
>   *((T *)e)
> |
>   ((T *)x)[...]
> |
>   ((T*)x)->f
> |
> 
> - (T*)
>   e
> )

Please, could you add this script in devtools/cocci/?

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 02/11] kni: remove unnecessary cast of void pointers
  2017-04-07 17:44 ` [PATCH 02/11] kni: remove unnecessary cast of void pointers Stephen Hemminger
@ 2017-04-10  9:29   ` Ferruh Yigit
  0 siblings, 0 replies; 15+ messages in thread
From: Ferruh Yigit @ 2017-04-10  9:29 UTC (permalink / raw)
  To: Stephen Hemminger, dev; +Cc: Stephen Hemminger

On 4/7/2017 6:44 PM, Stephen Hemminger wrote:
> Remove unnecessary casts of void * pointers to a specfic type.
> 
> Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>

Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 00/11] remove unnecessary cast of void pointers
  2017-04-07 17:44 [PATCH 00/11] remove unnecessary cast of void pointers Stephen Hemminger
                   ` (11 preceding siblings ...)
  2017-04-08 19:42 ` [PATCH 00/11] remove unnecessary cast of void pointers Thomas Monjalon
@ 2017-04-11 16:06 ` Thomas Monjalon
  12 siblings, 0 replies; 15+ messages in thread
From: Thomas Monjalon @ 2017-04-11 16:06 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: dev

2017-04-07 13:44, Stephen Hemminger:
> This is a set patches inspired by a set of Linux kernel patches
> by simran singhal <singhalsimran0@gmail.com>

Applied, thanks

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2017-04-11 16:06 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-07 17:44 [PATCH 00/11] remove unnecessary cast of void pointers Stephen Hemminger
2017-04-07 17:44 ` [PATCH 01/11] table: remove unnecessary void cast Stephen Hemminger
2017-04-07 17:44 ` [PATCH 02/11] kni: remove unnecessary cast of void pointers Stephen Hemminger
2017-04-10  9:29   ` Ferruh Yigit
2017-04-07 17:44 ` [PATCH 03/11] vhost: remove unnecessary cast of void pointer Stephen Hemminger
2017-04-07 17:44 ` [PATCH 04/11] port: remove unnecessary cast of void pointers Stephen Hemminger
2017-04-07 17:44 ` [PATCH 05/11] crypto: remove unnecessary cast of void pointer Stephen Hemminger
2017-04-07 17:44 ` [PATCH 06/11] acl: " Stephen Hemminger
2017-04-07 17:44 ` [PATCH 07/11] eal: " Stephen Hemminger
2017-04-07 17:44 ` [PATCH 08/11] net: remmove " Stephen Hemminger
2017-04-07 17:44 ` [PATCH 09/11] ether: remove " Stephen Hemminger
2017-04-07 17:44 ` [PATCH 10/11] mempool: " Stephen Hemminger
2017-04-07 17:44 ` [PATCH 11/11] test: " Stephen Hemminger
2017-04-08 19:42 ` [PATCH 00/11] remove unnecessary cast of void pointers Thomas Monjalon
2017-04-11 16:06 ` Thomas Monjalon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.