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 03/12] net/axgbe: remove unnecessary cast
Date: Wed, 29 May 2019 12:14:52 -0700
Message-ID: <20190529191501.19053-4-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/axgbe/axgbe_ethdev.c | 24 +++++++++++++++---------
 drivers/net/axgbe/axgbe_rxtx.c   |  2 +-
 2 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/drivers/net/axgbe/axgbe_ethdev.c b/drivers/net/axgbe/axgbe_ethdev.c
index 221979c5e9f5..6b3bc3eea34f 100644
--- a/drivers/net/axgbe/axgbe_ethdev.c
+++ b/drivers/net/axgbe/axgbe_ethdev.c
@@ -157,7 +157,7 @@ axgbe_dev_configure(struct rte_eth_dev *dev)
 static int
 axgbe_dev_rx_mq_config(struct rte_eth_dev *dev)
 {
-	struct axgbe_port *pdata = (struct axgbe_port *)dev->data->dev_private;
+	struct axgbe_port *pdata = dev->data->dev_private;
 
 	if (dev->data->dev_conf.rxmode.mq_mode == ETH_MQ_RX_RSS)
 		pdata->rss_enable = 1;
@@ -171,10 +171,11 @@ axgbe_dev_rx_mq_config(struct rte_eth_dev *dev)
 static int
 axgbe_dev_start(struct rte_eth_dev *dev)
 {
-	PMD_INIT_FUNC_TRACE();
-	struct axgbe_port *pdata = (struct axgbe_port *)dev->data->dev_private;
+	struct axgbe_port *pdata = dev->data->dev_private;
 	int ret;
 
+	PMD_INIT_FUNC_TRACE();
+
 	/* Multiqueue RSS */
 	ret = axgbe_dev_rx_mq_config(dev);
 	if (ret) {
@@ -209,9 +210,10 @@ axgbe_dev_start(struct rte_eth_dev *dev)
 static void
 axgbe_dev_stop(struct rte_eth_dev *dev)
 {
-	PMD_INIT_FUNC_TRACE();
 	struct axgbe_port *pdata = dev->data->dev_private;
 
+	PMD_INIT_FUNC_TRACE();
+
 	rte_intr_disable(&pdata->pci_dev->intr_handle);
 
 	if (axgbe_test_bit(AXGBE_STOPPED, &pdata->dev_state))
@@ -237,27 +239,30 @@ axgbe_dev_close(struct rte_eth_dev *dev)
 static void
 axgbe_dev_promiscuous_enable(struct rte_eth_dev *dev)
 {
-	PMD_INIT_FUNC_TRACE();
 	struct axgbe_port *pdata = dev->data->dev_private;
 
+	PMD_INIT_FUNC_TRACE();
+
 	AXGMAC_IOWRITE_BITS(pdata, MAC_PFR, PR, 1);
 }
 
 static void
 axgbe_dev_promiscuous_disable(struct rte_eth_dev *dev)
 {
-	PMD_INIT_FUNC_TRACE();
 	struct axgbe_port *pdata = dev->data->dev_private;
 
+	PMD_INIT_FUNC_TRACE();
+
 	AXGMAC_IOWRITE_BITS(pdata, MAC_PFR, PR, 0);
 }
 
 static void
 axgbe_dev_allmulticast_enable(struct rte_eth_dev *dev)
 {
-	PMD_INIT_FUNC_TRACE();
 	struct axgbe_port *pdata = dev->data->dev_private;
 
+	PMD_INIT_FUNC_TRACE();
+
 	if (AXGMAC_IOREAD_BITS(pdata, MAC_PFR, PM))
 		return;
 	AXGMAC_IOWRITE_BITS(pdata, MAC_PFR, PM, 1);
@@ -266,9 +271,10 @@ axgbe_dev_allmulticast_enable(struct rte_eth_dev *dev)
 static void
 axgbe_dev_allmulticast_disable(struct rte_eth_dev *dev)
 {
-	PMD_INIT_FUNC_TRACE();
 	struct axgbe_port *pdata = dev->data->dev_private;
 
+	PMD_INIT_FUNC_TRACE();
+
 	if (!AXGMAC_IOREAD_BITS(pdata, MAC_PFR, PM))
 		return;
 	AXGMAC_IOWRITE_BITS(pdata, MAC_PFR, PM, 0);
@@ -578,7 +584,7 @@ eth_axgbe_dev_init(struct rte_eth_dev *eth_dev)
 	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
 		return 0;
 
-	pdata = (struct axgbe_port *)eth_dev->data->dev_private;
+	pdata = eth_dev->data->dev_private;
 	/* initial state */
 	axgbe_set_bit(AXGBE_DOWN, &pdata->dev_state);
 	axgbe_set_bit(AXGBE_STOPPED, &pdata->dev_state);
diff --git a/drivers/net/axgbe/axgbe_rxtx.c b/drivers/net/axgbe/axgbe_rxtx.c
index e76601d149d5..cfc55b359ae8 100644
--- a/drivers/net/axgbe/axgbe_rxtx.c
+++ b/drivers/net/axgbe/axgbe_rxtx.c
@@ -342,7 +342,7 @@ int axgbe_dev_tx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
 	const struct rte_memzone *tz;
 
 	tx_desc = nb_desc;
-	pdata = (struct axgbe_port *)dev->data->dev_private;
+	pdata = dev->data->dev_private;
 
 	/*
 	 * validate tx descriptors count
-- 
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 ` [dpdk-dev] [PATCH 02/12] net/ark: " Stephen Hemminger
2019-05-29 19:14 ` Stephen Hemminger [this message]
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-4-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