[dpdk-dev] [PATCH 01/12] net/atlantic: remove unnecessary cast

Stephen Hemminger stephen at networkplumber.org
Wed May 29 21:14:50 CEST 2019


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

Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
---
 drivers/net/atlantic/atl_ethdev.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/net/atlantic/atl_ethdev.c b/drivers/net/atlantic/atl_ethdev.c
index d110e351ec03..fdc0a7f2db96 100644
--- a/drivers/net/atlantic/atl_ethdev.c
+++ b/drivers/net/atlantic/atl_ethdev.c
@@ -371,8 +371,7 @@ atl_disable_intr(struct aq_hw_s *hw)
 static int
 eth_atl_dev_init(struct rte_eth_dev *eth_dev)
 {
-	struct atl_adapter *adapter =
-		(struct atl_adapter *)eth_dev->data->dev_private;
+	struct atl_adapter *adapter = eth_dev->data->dev_private;
 	struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
 	struct rte_intr_handle *intr_handle = &pci_dev->intr_handle;
 	struct aq_hw_s *hw = ATL_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private);
@@ -1015,8 +1014,7 @@ static int
 atl_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *stats,
 		   unsigned int n)
 {
-	struct atl_adapter *adapter =
-	(struct atl_adapter *)dev->data->dev_private;
+	struct atl_adapter *adapter = dev->data->dev_private;
 	struct aq_hw_s *hw = &adapter->hw;
 	struct get_stats req = { 0 };
 	struct macsec_msg_fw_request msg = { 0 };
@@ -1352,8 +1350,7 @@ atl_dev_interrupt_action(struct rte_eth_dev *dev,
 {
 	struct atl_interrupt *intr =
 		ATL_DEV_PRIVATE_TO_INTR(dev->data->dev_private);
-	struct atl_adapter *adapter =
-		(struct atl_adapter *)dev->data->dev_private;
+	struct atl_adapter *adapter = dev->data->dev_private;
 	struct aq_hw_s *hw = &adapter->hw;
 
 	if (!(intr->flags & ATL_FLAG_NEED_LINK_UPDATE))
-- 
2.20.1



More information about the dev mailing list