From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id D5308A045E for ; Wed, 29 May 2019 21:15:37 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A86551B994; Wed, 29 May 2019 21:15:13 +0200 (CEST) Received: from mail-pf1-f194.google.com (mail-pf1-f194.google.com [209.85.210.194]) by dpdk.org (Postfix) with ESMTP id 3127C1B953 for ; Wed, 29 May 2019 21:15:07 +0200 (CEST) Received: by mail-pf1-f194.google.com with SMTP id r22so2239228pfh.9 for ; Wed, 29 May 2019 12:15:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IMK3r+wfq74TxvgCCn9/fCes/WIOvHDAB6oWuzMMj8Y=; b=zRmTBE2i+CRhLHe5x9zOi+cho569bGBDSmlk4NnY9Qe1r1tKpRdOdMqpSgXvaqibDV buI0HT4/hEOJQNkBEH4jXkTJTpVjDys8Qe34hNvFcAzY7dt10i7yvQfMfL9NZrfUmx7y BlHhbreLBvkSDABSrjgMPCIv1XTkq4mx87d4K1Vmak+D6fQIw5REOTJkk763MsP2yTYC AW73wpPgucjPko4MOJQAFdp/p0s1N2sCnW4s3p12Nc5iHw0zCrU5dtVz5h1w9OVJ+Ler 3D28uANI7gQsEEtM/i7sgta6p7IYF/x0iLRom6UvGv/xJOZ2J5XxY5NSljTVJELWLfN6 XAgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=IMK3r+wfq74TxvgCCn9/fCes/WIOvHDAB6oWuzMMj8Y=; b=DOlR9Lglb2Y0MVUVNuAaDVu+nO5B9osrVeHeCqnn1itUB3/bt7afsBF89SVVET8vVm RTuJhknIMEhcWRO0CUFPcdKjVMl4cAwofTB8ANI78DquXVSTQTTkfHGO5/vKHweFfe/q Ks6mhzrp6LKwNqlRDUW3hJXMf7u1pFnG19gSLbqM/zFdnBSgnORLgwu43eRbK05GOkiV BK50T1VfmA3HlPRwW22BaO67g4vSVIeXYjMWVuKbsnn3vusgVTi5ides7lTKiy+Eu1hR N0PWulw/xLG+vHr/c4VUfpOGQ3JSPQSxBIne4mcvwgIAPG0eCbOIScnf9aAk4HACcqs9 YOYw== X-Gm-Message-State: APjAAAUbMvvbLR2g95zMTdyWllC0v43g/JyBgddiVrJvXflnJaCOBmfp ITgoAqmVa8YwsYUzzmOeKTgoxtgaGRs= X-Google-Smtp-Source: APXvYqxU6f7t0F5C/KReJ3XrJG4BS4UzbyPQD35UEW0Ht/1En2B4aaURIsBXlGjDlC29FdehcTBlJA== X-Received: by 2002:a63:fa16:: with SMTP id y22mr101245037pgh.15.1559157306042; Wed, 29 May 2019 12:15:06 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id t18sm142943pgm.69.2019.05.29.12.15.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 May 2019 12:15:05 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Wed, 29 May 2019 12:14:52 -0700 Message-Id: <20190529191501.19053-4-stephen@networkplumber.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190529191501.19053-1-stephen@networkplumber.org> References: <20190529191501.19053-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 03/12] net/axgbe: remove unnecessary cast X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The device private pointer (dev_private) is of type void * therefore no cast is necessary in C. Signed-off-by: Stephen Hemminger --- 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