net/axgbe: remove unnecessary cast
authorStephen Hemminger <stephen@networkplumber.org>
Wed, 29 May 2019 19:14:52 +0000 (12:14 -0700)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 13 Jun 2019 14:54:29 +0000 (23:54 +0900)
The device private pointer (dev_private) is of type void *
therefore no cast is necessary in C.

Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
drivers/net/axgbe/axgbe_ethdev.c
drivers/net/axgbe/axgbe_rxtx.c

index 221979c..6b3bc3e 100644 (file)
@@ -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);
index e76601d..cfc55b3 100644 (file)
@@ -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