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 02/12] net/ark: remove unnecessary cast
Date: Wed, 29 May 2019 12:14:51 -0700
Message-ID: <20190529191501.19053-3-stephen@networkplumber.org> (raw)
In-Reply-To: <20190529191501.19053-1-stephen@networkplumber.org>

The device private pointer (dev_private) is of type void *
therefore no cast is necessary in C.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/ark/ark_ethdev.c    | 51 +++++++++++----------------------
 drivers/net/ark/ark_ethdev_rx.c |  4 +--
 drivers/net/ark/ark_ethdev_tx.c |  2 +-
 3 files changed, 20 insertions(+), 37 deletions(-)

diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c
index 7692aa2d9571..7fd784cd0e30 100644
--- a/drivers/net/ark/ark_ethdev.c
+++ b/drivers/net/ark/ark_ethdev.c
@@ -241,8 +241,7 @@ check_for_ext(struct ark_adapter *ark)
 static int
 eth_ark_dev_init(struct rte_eth_dev *dev)
 {
-	struct ark_adapter *ark =
-		(struct ark_adapter *)dev->data->dev_private;
+	struct ark_adapter *ark = dev->data->dev_private;
 	struct rte_pci_device *pci_dev;
 	int ret;
 	int port_count = 1;
@@ -418,8 +417,7 @@ eth_ark_dev_init(struct rte_eth_dev *dev)
 static int
 ark_config_device(struct rte_eth_dev *dev)
 {
-	struct ark_adapter *ark =
-		(struct ark_adapter *)dev->data->dev_private;
+	struct ark_adapter *ark = dev->data->dev_private;
 	uint16_t num_q, i;
 	struct ark_mpu_t *mpu;
 
@@ -494,8 +492,7 @@ ark_config_device(struct rte_eth_dev *dev)
 static int
 eth_ark_dev_uninit(struct rte_eth_dev *dev)
 {
-	struct ark_adapter *ark =
-		(struct ark_adapter *)dev->data->dev_private;
+	struct ark_adapter *ark = dev->data->dev_private;
 
 	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
 		return 0;
@@ -517,8 +514,7 @@ static int
 eth_ark_dev_configure(struct rte_eth_dev *dev)
 {
 	PMD_FUNC_LOG(DEBUG, "\n");
-	struct ark_adapter *ark =
-		(struct ark_adapter *)dev->data->dev_private;
+	struct ark_adapter *ark = dev->data->dev_private;
 
 	eth_ark_dev_set_link_up(dev);
 	if (ark->user_ext.dev_configure)
@@ -544,8 +540,7 @@ delay_pg_start(void *arg)
 static int
 eth_ark_dev_start(struct rte_eth_dev *dev)
 {
-	struct ark_adapter *ark =
-		(struct ark_adapter *)dev->data->dev_private;
+	struct ark_adapter *ark = dev->data->dev_private;
 	int i;
 
 	PMD_FUNC_LOG(DEBUG, "\n");
@@ -597,8 +592,7 @@ eth_ark_dev_stop(struct rte_eth_dev *dev)
 {
 	uint16_t i;
 	int status;
-	struct ark_adapter *ark =
-		(struct ark_adapter *)dev->data->dev_private;
+	struct ark_adapter *ark = dev->data->dev_private;
 	struct ark_mpu_t *mpu;
 
 	PMD_FUNC_LOG(DEBUG, "\n");
@@ -688,8 +682,7 @@ eth_ark_dev_stop(struct rte_eth_dev *dev)
 static void
 eth_ark_dev_close(struct rte_eth_dev *dev)
 {
-	struct ark_adapter *ark =
-		(struct ark_adapter *)dev->data->dev_private;
+	struct ark_adapter *ark = dev->data->dev_private;
 	uint16_t i;
 
 	if (ark->user_ext.dev_close)
@@ -719,8 +712,7 @@ static void
 eth_ark_dev_info_get(struct rte_eth_dev *dev,
 		     struct rte_eth_dev_info *dev_info)
 {
-	struct ark_adapter *ark =
-		(struct ark_adapter *)dev->data->dev_private;
+	struct ark_adapter *ark = dev->data->dev_private;
 	struct ark_mpu_t *tx_mpu = RTE_PTR_ADD(ark->bar0, ARK_MPU_TX_BASE);
 	struct ark_mpu_t *rx_mpu = RTE_PTR_ADD(ark->bar0, ARK_MPU_RX_BASE);
 	uint16_t ports = ark->num_ports;
@@ -755,8 +747,7 @@ eth_ark_dev_link_update(struct rte_eth_dev *dev, int wait_to_complete)
 {
 	PMD_DEBUG_LOG(DEBUG, "link status = %d\n",
 			dev->data->dev_link.link_status);
-	struct ark_adapter *ark =
-		(struct ark_adapter *)dev->data->dev_private;
+	struct ark_adapter *ark = dev->data->dev_private;
 
 	if (ark->user_ext.link_update) {
 		return ark->user_ext.link_update
@@ -770,8 +761,7 @@ static int
 eth_ark_dev_set_link_up(struct rte_eth_dev *dev)
 {
 	dev->data->dev_link.link_status = 1;
-	struct ark_adapter *ark =
-		(struct ark_adapter *)dev->data->dev_private;
+	struct ark_adapter *ark = dev->data->dev_private;
 
 	if (ark->user_ext.dev_set_link_up)
 		return ark->user_ext.dev_set_link_up(dev,
@@ -783,8 +773,7 @@ static int
 eth_ark_dev_set_link_down(struct rte_eth_dev *dev)
 {
 	dev->data->dev_link.link_status = 0;
-	struct ark_adapter *ark =
-		(struct ark_adapter *)dev->data->dev_private;
+	struct ark_adapter *ark = dev->data->dev_private;
 
 	if (ark->user_ext.dev_set_link_down)
 		return ark->user_ext.dev_set_link_down(dev,
@@ -796,8 +785,7 @@ static int
 eth_ark_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)
 {
 	uint16_t i;
-	struct ark_adapter *ark =
-		(struct ark_adapter *)dev->data->dev_private;
+	struct ark_adapter *ark = dev->data->dev_private;
 
 	stats->ipackets = 0;
 	stats->ibytes = 0;
@@ -820,8 +808,7 @@ static void
 eth_ark_dev_stats_reset(struct rte_eth_dev *dev)
 {
 	uint16_t i;
-	struct ark_adapter *ark =
-		(struct ark_adapter *)dev->data->dev_private;
+	struct ark_adapter *ark = dev->data->dev_private;
 
 	for (i = 0; i < dev->data->nb_tx_queues; i++)
 		eth_tx_queue_stats_reset(dev->data->tx_queues[i]);
@@ -838,8 +825,7 @@ eth_ark_macaddr_add(struct rte_eth_dev *dev,
 		    uint32_t index,
 		    uint32_t pool)
 {
-	struct ark_adapter *ark =
-		(struct ark_adapter *)dev->data->dev_private;
+	struct ark_adapter *ark = dev->data->dev_private;
 
 	if (ark->user_ext.mac_addr_add) {
 		ark->user_ext.mac_addr_add(dev,
@@ -855,8 +841,7 @@ eth_ark_macaddr_add(struct rte_eth_dev *dev,
 static void
 eth_ark_macaddr_remove(struct rte_eth_dev *dev, uint32_t index)
 {
-	struct ark_adapter *ark =
-		(struct ark_adapter *)dev->data->dev_private;
+	struct ark_adapter *ark = dev->data->dev_private;
 
 	if (ark->user_ext.mac_addr_remove)
 		ark->user_ext.mac_addr_remove(dev, index,
@@ -867,8 +852,7 @@ static int
 eth_ark_set_default_mac_addr(struct rte_eth_dev *dev,
 			     struct rte_ether_addr *mac_addr)
 {
-	struct ark_adapter *ark =
-		(struct ark_adapter *)dev->data->dev_private;
+	struct ark_adapter *ark = dev->data->dev_private;
 
 	if (ark->user_ext.mac_addr_set) {
 		ark->user_ext.mac_addr_set(dev, mac_addr,
@@ -881,8 +865,7 @@ eth_ark_set_default_mac_addr(struct rte_eth_dev *dev,
 static int
 eth_ark_set_mtu(struct rte_eth_dev *dev, uint16_t  size)
 {
-	struct ark_adapter *ark =
-		(struct ark_adapter *)dev->data->dev_private;
+	struct ark_adapter *ark = dev->data->dev_private;
 
 	if (ark->user_ext.set_mtu)
 		return ark->user_ext.set_mtu(dev, size,
diff --git a/drivers/net/ark/ark_ethdev_rx.c b/drivers/net/ark/ark_ethdev_rx.c
index 300029d6b86e..7de1a9851683 100644
--- a/drivers/net/ark/ark_ethdev_rx.c
+++ b/drivers/net/ark/ark_ethdev_rx.c
@@ -121,7 +121,7 @@ eth_ark_dev_rx_queue_setup(struct rte_eth_dev *dev,
 			   struct rte_mempool *mb_pool)
 {
 	static int warning1;		/* = 0 */
-	struct ark_adapter *ark = (struct ark_adapter *)dev->data->dev_private;
+	struct ark_adapter *ark = dev->data->dev_private;
 
 	struct ark_rx_queue *queue;
 	uint32_t i;
@@ -611,7 +611,7 @@ eth_rx_queue_stats_reset(void *vqueue)
 void
 eth_ark_udm_force_close(struct rte_eth_dev *dev)
 {
-	struct ark_adapter *ark = (struct ark_adapter *)dev->data->dev_private;
+	struct ark_adapter *ark = dev->data->dev_private;
 	struct ark_rx_queue *queue;
 	uint32_t index;
 	uint16_t i;
diff --git a/drivers/net/ark/ark_ethdev_tx.c b/drivers/net/ark/ark_ethdev_tx.c
index 94da5f9580a2..1967655707aa 100644
--- a/drivers/net/ark/ark_ethdev_tx.c
+++ b/drivers/net/ark/ark_ethdev_tx.c
@@ -207,7 +207,7 @@ eth_ark_tx_queue_setup(struct rte_eth_dev *dev,
 		       unsigned int socket_id,
 		       const struct rte_eth_txconf *tx_conf __rte_unused)
 {
-	struct ark_adapter *ark = (struct ark_adapter *)dev->data->dev_private;
+	struct ark_adapter *ark = dev->data->dev_private;
 	struct ark_tx_queue *queue;
 	int status;
 
-- 
2.20.1


  parent reply	other threads:[~2019-05-29 19:15 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-29 19:14 [dpdk-dev] [PATCH 00/12] cleanup useless casts of void * Stephen Hemminger
2019-05-29 19:14 ` [dpdk-dev] [PATCH 01/12] net/atlantic: remove unnecessary cast Stephen Hemminger
2019-05-29 19:14 ` Stephen Hemminger [this message]
2019-05-29 19:14 ` [dpdk-dev] [PATCH 03/12] net/axgbe: " Stephen Hemminger
2019-05-29 19:14 ` [dpdk-dev] [PATCH 04/12] net/bnxt: " Stephen Hemminger
2019-06-04 13:27   ` Lance Richardson
2019-05-29 19:14 ` [dpdk-dev] [PATCH 05/12] net/bonding: " Stephen Hemminger
2019-05-29 19:14 ` [dpdk-dev] [PATCH 06/12] net/cxgbe: " Stephen Hemminger
2019-05-29 19:14 ` [dpdk-dev] [PATCH 07/12] net/e1000: remove unnecessary cast of void * Stephen Hemminger
2019-05-29 19:14 ` [dpdk-dev] [PATCH 08/12] net/ena: remove unnecessary cast Stephen Hemminger
2019-06-05 14:28   ` Ferruh Yigit
2019-05-29 19:14 ` [dpdk-dev] [PATCH 09/12] net/enic: " Stephen Hemminger
2019-05-29 19:14 ` [dpdk-dev] [PATCH 10/12] net/i40e: " Stephen Hemminger
2019-05-29 19:15 ` [dpdk-dev] [PATCH 11/12] net/ixgbe: " Stephen Hemminger
2019-06-05 14:28   ` Ferruh Yigit
2019-05-29 19:15 ` [dpdk-dev] [PATCH 12/12] net/mlx5: " Stephen Hemminger
2019-06-05 14:28 ` [dpdk-dev] [PATCH 00/12] cleanup useless casts of void * Ferruh Yigit

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=20190529191501.19053-3-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

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git