From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 244C342B42; Fri, 19 May 2023 05:01:04 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E486342D51; Fri, 19 May 2023 05:00:30 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2096.outbound.protection.outlook.com [40.107.243.96]) by mails.dpdk.org (Postfix) with ESMTP id CC61C42D55 for ; Fri, 19 May 2023 05:00:28 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CdGe6unhi08FnRwOvEpXRFMj0xnNwksTdd9R1u+8Ofy4I+5ISlYWoQqNkGD2M/B/YgjrtyQREIcUph0yDhwh0J5cL2XOGCjzISpXd6di5pKCR5fPtOUtunqwS6kMG75MvFucvv3Iosp2T7d/5JaF4llAuhlOnM6fNW/7R5ytJgLbRrTs6xLCVKzBdwThzRC4h1eG1pTbnG9dY8lbiaF3udg336cwf/R7RLnjdvv+R+9NmHV1ed6h98VTn6UgTER1QsItrtZC4kovCkST8Jfoquan8vJ7k+zsnezBp5nX9FXrNgfBOPacMCe059ftHsDgUyAuMk7Z/mS0qXQiU4YgQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=/wgDvtOoFIpcFGqTcwKVAGdxkRzfSfQpvJV6n/sJMIE=; b=UPM6BBnPbFbsgYacA6+u0TU3Go4xcnxp4V0DmFSB4TpmvkPc8IwrCUcEx9eeOGE1j0qB0VzyAPXI1F5ef98A5gJvnh4x62XrIQhTVZSJJRcLkR2N+KWLfbMWmpSfWRr9nMlOZ2JCpeHppSFnBfxve7vzP1Ss4qAcWLgZAECCh6/IxEZ957oIMdn1opF5vK3hicyKa+wp4gYJKL/Ii13LQjXgsPeDGD7myIn5PtV3dVA75qf2I3+TJ9VVs+Ddw7TLa1LKOzx5vzCfq7CTDsRSfKLDmWuUU/EdonYk/LakuuFq+YQr5N6MeqDVMOeKoNOpavOx2UXkFKCL+5RU5u3QOQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/wgDvtOoFIpcFGqTcwKVAGdxkRzfSfQpvJV6n/sJMIE=; b=CQ4ezzliAcFjEb2tujOzUdB+cg+DErE3XgE9njLe6LUnkm2UxHP39oV5rVnVJ1BvEDg3Ezw73HQAx7QWPUemO7PNlhCCVevzJFeyvfCD6Mm2H8mq+UpLhKCRUjavns2J6a1a0cc2esVVYDfD7A4YfnF06Ej++BjQ752GjEkgbrE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) by SJ0PR13MB5769.namprd13.prod.outlook.com (2603:10b6:a03:40c::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6387.30; Fri, 19 May 2023 03:00:26 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::ac2e:52b6:82ec:4994]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::ac2e:52b6:82ec:4994%3]) with mapi id 15.20.6411.017; Fri, 19 May 2023 03:00:26 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com, Chaoyong He Subject: [PATCH 7/8] net/nfp: revise cast from void pointer Date: Fri, 19 May 2023 10:59:49 +0800 Message-Id: <20230519025950.1642943-8-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230519025950.1642943-1-chaoyong.he@corigine.com> References: <20230519025950.1642943-1-chaoyong.he@corigine.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SI2PR01CA0005.apcprd01.prod.exchangelabs.com (2603:1096:4:191::23) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|SJ0PR13MB5769:EE_ X-MS-Office365-Filtering-Correlation-Id: 5f73a7de-2ca0-4b4e-d68f-08db58153218 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: jdD1XKiaCobAc3QH92qEMnZhfeYO3c0GK1YxsIbqfKNFiLxU3MoCrptGvyfgNnrV0Bb009dTGpD5Wc9IZiVQLCsn4+czt/R9zqvn8JPf5KE/yl0v/GdarIzLjI9zr6Py1PcX6tirj7O4rN62Cu64UfvT9DhDj7jADuZSs2gmYoSfkqYkrQpyZ90sxganG4AvkuVB4DEbEiF/AkUBKauP4WjXPrgS3oqh8TZ22v0lyCj9piSd8ujHfwc/QWLLxhZSWSHeMTOZ4G+IxMAl6tH2j+KaN0E1sdnvpsRuDpncMxAB+ofwuaE+7LhNkwFr2rpDr+tEu4wB+EUDmterD9d8F+Yc/jFGBvmMIA/02JqBgLWOh0l/Jnv1ZupqZyXiPU13tdUlLTjExfof6fYMZwzSJBhcmciwjmvtZnWTi2h9rtoO1xFLz1x2kkZDBZ0xW8ipB1jc7cOLtS4IAMo6oGGd1C8Rg7ueti7Ds6GsZpui9X9aMrWLkp4CGCDWmIsBm7oz1Fxgs5Ke8/RzNChC9p6+6HfkzLX1saTmcogQCl1mS5xg7Lwq1RPRpCGxSnauirw0e0t3d0iD/IpF53hCBFIwJfFSnj/FcMxr0f/pAjbsfl9HE+kC7zH5sAbsKN9vmn5M X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR13MB5545.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(4636009)(366004)(346002)(136003)(376002)(39840400004)(396003)(451199021)(6916009)(30864003)(66476007)(66574015)(2616005)(6666004)(6512007)(41300700001)(2906002)(6486002)(83380400001)(478600001)(66556008)(107886003)(52116002)(66946007)(26005)(6506007)(1076003)(186003)(5660300002)(4326008)(316002)(8676002)(8936002)(44832011)(86362001)(38100700002)(36756003)(38350700002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?dkJWTVhVSUNQWmlSSGx1TU9zeHZMU1lGRmwzU2J0SitPY0dKY0NzTisxV1gx?= =?utf-8?B?RU8zb3BhWUFGTEhRWnBmNU94Z1d2U1orZVJnUzY2Skh1RnRJSE04VmxHTXpt?= =?utf-8?B?bGs1ZGFwMDloNWhWeTNaWFpFTklERnkrMzVDRHR2OHBpalRIMlBpMUlSWUhQ?= =?utf-8?B?MjFhQ2hma0VTNko5RmRrL3ZmeDlxMWM0Q3JraTBhSkNPTnNQNFpXNG9XS1o0?= =?utf-8?B?RTFzUk9leUpKNWdTUWRXVDhPcCtHQWN1ME02aGN0VVpwVEU2RGU0aGRsUGd6?= =?utf-8?B?TVdwVXdLanBYU0ZnMjJBc25JV2pzamxUc1RUNnpoa2ViRnArRGJIQXNNU01W?= =?utf-8?B?WDl3Vk5weGpKR094TEtpcC9Mc05ZajUreS93di80NmoybVFwblVDQkh6eHd0?= =?utf-8?B?dEk1RGpKZGZyY3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-4b4e-d68f-08db58153218 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 May 2023 03:00:26.4782 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: /UmCKUGmhG10AylECSlapweOQ4ZP2IXakG5yrZ6E/Iurj7NgkVx9N8zE6d98dz9zp6WoDNFDLhOqh4yMzzQNSiG3f7ts7EDJzcrSOcth++M= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR13MB5769 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org When cast from void pointer to other pointer type, there is not need to use '()' for force cast. Signed-off-by: Chaoyong He Reviewed-by: Niklas Söderlund --- drivers/net/nfp/flower/nfp_flower.c | 20 +++---- .../net/nfp/flower/nfp_flower_representor.c | 30 +++++------ drivers/net/nfp/nfp_common.c | 12 ++--- drivers/net/nfp/nfp_ethdev.c | 2 +- drivers/net/nfp/nfp_ethdev_vf.c | 2 +- drivers/net/nfp/nfp_flow.c | 54 +++++++++---------- drivers/net/nfp/nfp_rxtx.c | 2 +- drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c | 2 +- 8 files changed, 60 insertions(+), 64 deletions(-) diff --git a/drivers/net/nfp/flower/nfp_flower.c b/drivers/net/nfp/flower/nfp_flower.c index 9a08ae3b75..72933e55d0 100644 --- a/drivers/net/nfp/flower/nfp_flower.c +++ b/drivers/net/nfp/flower/nfp_flower.c @@ -60,7 +60,7 @@ nfp_pf_repr_disable_queues(struct rte_eth_dev *dev) uint32_t update = 0; struct nfp_flower_representor *repr; - repr = (struct nfp_flower_representor *)dev->data->dev_private; + repr = dev->data->dev_private; hw = repr->app_fw_flower->pf_hw; nn_cfg_writeq(hw, NFP_NET_CFG_TXRS_ENABLE, 0); @@ -89,7 +89,7 @@ nfp_flower_pf_start(struct rte_eth_dev *dev) struct nfp_net_hw *hw; struct nfp_flower_representor *repr; - repr = (struct nfp_flower_representor *)dev->data->dev_private; + repr = dev->data->dev_private; hw = repr->app_fw_flower->pf_hw; /* Disabling queues just in case... */ @@ -149,19 +149,19 @@ nfp_flower_pf_stop(struct rte_eth_dev *dev) struct nfp_net_rxq *this_rx_q; struct nfp_flower_representor *repr; - repr = (struct nfp_flower_representor *)dev->data->dev_private; + repr = dev->data->dev_private; hw = repr->app_fw_flower->pf_hw; nfp_pf_repr_disable_queues(dev); /* Clear queues */ for (i = 0; i < dev->data->nb_tx_queues; i++) { - this_tx_q = (struct nfp_net_txq *)dev->data->tx_queues[i]; + this_tx_q = dev->data->tx_queues[i]; nfp_net_reset_tx_queue(this_tx_q); } for (i = 0; i < dev->data->nb_rx_queues; i++) { - this_rx_q = (struct nfp_net_rxq *)dev->data->rx_queues[i]; + this_rx_q = dev->data->rx_queues[i]; nfp_net_reset_rx_queue(this_rx_q); } @@ -189,7 +189,7 @@ nfp_flower_pf_close(struct rte_eth_dev *dev) if (rte_eal_process_type() != RTE_PROC_PRIMARY) return 0; - repr = (struct nfp_flower_representor *)dev->data->dev_private; + repr = dev->data->dev_private; hw = repr->app_fw_flower->pf_hw; pf_dev = hw->pf_dev; app_fw_flower = NFP_PRIV_TO_APP_FW_FLOWER(pf_dev->app_fw_priv); @@ -204,12 +204,12 @@ nfp_flower_pf_close(struct rte_eth_dev *dev) /* Clear queues */ for (i = 0; i < dev->data->nb_tx_queues; i++) { - this_tx_q = (struct nfp_net_txq *)dev->data->tx_queues[i]; + this_tx_q = dev->data->tx_queues[i]; nfp_net_reset_tx_queue(this_tx_q); } for (i = 0; i < dev->data->nb_rx_queues; i++) { - this_rx_q = (struct nfp_net_rxq *)dev->data->rx_queues[i]; + this_rx_q = dev->data->rx_queues[i]; nfp_net_reset_rx_queue(this_rx_q); } @@ -814,7 +814,7 @@ nfp_flower_init_ctrl_vnic(struct nfp_net_hw *hw) /* Saving physical and virtual addresses for the RX ring */ rxq->dma = (uint64_t)tz->iova; - rxq->rxds = (struct nfp_net_rx_desc *)tz->addr; + rxq->rxds = tz->addr; /* Mbuf pointers array for referencing mbufs linked to RX descriptors */ rxq->rxbufs = rte_zmalloc_socket("rxq->rxbufs", @@ -877,7 +877,7 @@ nfp_flower_init_ctrl_vnic(struct nfp_net_hw *hw) /* Saving physical and virtual addresses for the TX ring */ txq->dma = (uint64_t)tz->iova; - txq->txds = (struct nfp_net_nfd3_tx_desc *)tz->addr; + txq->txds = tz->addr; /* Mbuf pointers array for referencing mbufs linked to TX descriptors */ txq->txbufs = rte_zmalloc_socket("txq->txbufs", diff --git a/drivers/net/nfp/flower/nfp_flower_representor.c b/drivers/net/nfp/flower/nfp_flower_representor.c index 0479eb4792..86b7d1a220 100644 --- a/drivers/net/nfp/flower/nfp_flower_representor.c +++ b/drivers/net/nfp/flower/nfp_flower_representor.c @@ -32,7 +32,7 @@ nfp_pf_repr_rx_queue_setup(struct rte_eth_dev *dev, const struct rte_memzone *tz; struct nfp_flower_representor *repr; - repr = (struct nfp_flower_representor *)dev->data->dev_private; + repr = dev->data->dev_private; hw = repr->app_fw_flower->pf_hw; /* Allocating rx queue data structure */ @@ -78,7 +78,7 @@ nfp_pf_repr_rx_queue_setup(struct rte_eth_dev *dev, /* Saving physical and virtual addresses for the RX ring */ rxq->dma = (uint64_t)tz->iova; - rxq->rxds = (struct nfp_net_rx_desc *)tz->addr; + rxq->rxds = tz->addr; /* mbuf pointers array for referencing mbufs linked to RX descriptors */ rxq->rxbufs = rte_zmalloc_socket("rxq->rxbufs", @@ -116,7 +116,7 @@ nfp_pf_repr_tx_queue_setup(struct rte_eth_dev *dev, const struct rte_memzone *tz; struct nfp_flower_representor *repr; - repr = (struct nfp_flower_representor *)dev->data->dev_private; + repr = dev->data->dev_private; hw = repr->app_fw_flower->pf_hw; tx_free_thresh = (tx_conf->tx_free_thresh) ? tx_conf->tx_free_thresh : @@ -161,7 +161,7 @@ nfp_pf_repr_tx_queue_setup(struct rte_eth_dev *dev, /* Saving physical and virtual addresses for the TX ring */ txq->dma = (uint64_t)tz->iova; - txq->txds = (struct nfp_net_nfd3_tx_desc *)tz->addr; + txq->txds = tz->addr; /* mbuf pointers array for referencing mbufs linked to TX descriptors */ txq->txbufs = rte_zmalloc_socket("txq->txbufs", @@ -207,7 +207,7 @@ nfp_flower_repr_link_update(struct rte_eth_dev *dev, [NFP_NET_CFG_STS_LINK_RATE_100G] = RTE_ETH_SPEED_NUM_100G, }; - repr = (struct nfp_flower_representor *)dev->data->dev_private; + repr = dev->data->dev_private; link = &repr->link; pf_hw = repr->app_fw_flower->pf_hw; @@ -273,7 +273,7 @@ nfp_flower_repr_dev_configure(struct rte_eth_dev *dev) struct rte_eth_rxmode *rxmode; struct nfp_flower_representor *repr; - repr = (struct nfp_flower_representor *)dev->data->dev_private; + repr = dev->data->dev_private; pf_hw = repr->app_fw_flower->pf_hw; dev_conf = &dev->data->dev_conf; @@ -295,7 +295,7 @@ nfp_flower_repr_dev_start(struct rte_eth_dev *dev) struct nfp_flower_representor *repr; struct nfp_app_fw_flower *app_fw_flower; - repr = (struct nfp_flower_representor *)dev->data->dev_private; + repr = dev->data->dev_private; app_fw_flower = repr->app_fw_flower; if (repr->repr_type == NFP_REPR_TYPE_PHYS_PORT) { @@ -314,7 +314,7 @@ nfp_flower_repr_dev_stop(struct rte_eth_dev *dev) struct nfp_flower_representor *repr; struct nfp_app_fw_flower *app_fw_flower; - repr = (struct nfp_flower_representor *)dev->data->dev_private; + repr = dev->data->dev_private; app_fw_flower = repr->app_fw_flower; nfp_flower_cmsg_port_mod(app_fw_flower, repr->port_id, false); @@ -339,7 +339,7 @@ nfp_flower_repr_rx_queue_setup(struct rte_eth_dev *dev, struct nfp_net_hw *pf_hw; struct nfp_flower_representor *repr; - repr = (struct nfp_flower_representor *)dev->data->dev_private; + repr = dev->data->dev_private; pf_hw = repr->app_fw_flower->pf_hw; /* Allocating rx queue data structure */ @@ -367,7 +367,7 @@ nfp_flower_repr_tx_queue_setup(struct rte_eth_dev *dev, struct nfp_net_hw *pf_hw; struct nfp_flower_representor *repr; - repr = (struct nfp_flower_representor *)dev->data->dev_private; + repr = dev->data->dev_private; pf_hw = repr->app_fw_flower->pf_hw; /* Allocating tx queue data structure */ @@ -390,7 +390,7 @@ nfp_flower_repr_stats_get(struct rte_eth_dev *ethdev, { struct nfp_flower_representor *repr; - repr = (struct nfp_flower_representor *)ethdev->data->dev_private; + repr = ethdev->data->dev_private; rte_memcpy(stats, &repr->repr_stats, sizeof(struct rte_eth_stats)); return 0; @@ -401,7 +401,7 @@ nfp_flower_repr_stats_reset(struct rte_eth_dev *ethdev) { struct nfp_flower_representor *repr; - repr = (struct nfp_flower_representor *)ethdev->data->dev_private; + repr = ethdev->data->dev_private; memset(&repr->repr_stats, 0, sizeof(struct rte_eth_stats)); return 0; @@ -413,7 +413,7 @@ nfp_flower_repr_mac_addr_set(struct rte_eth_dev *ethdev, { struct nfp_flower_representor *repr; - repr = (struct nfp_flower_representor *)ethdev->data->dev_private; + repr = ethdev->data->dev_private; rte_ether_addr_copy(mac_addr, &repr->mac_addr); rte_ether_addr_copy(mac_addr, ethdev->data->mac_addrs); @@ -584,7 +584,7 @@ nfp_flower_pf_repr_init(struct rte_eth_dev *eth_dev, struct nfp_flower_representor *init_repr_data; /* Cast the input representor data to the correct struct here */ - init_repr_data = (struct nfp_flower_representor *)init_params; + init_repr_data = init_params; /* Memory has been allocated in the eth_dev_create() function */ repr = eth_dev->data->dev_private; @@ -639,7 +639,7 @@ nfp_flower_repr_init(struct rte_eth_dev *eth_dev, struct nfp_flower_representor *init_repr_data; /* Cast the input representor data to the correct struct here */ - init_repr_data = (struct nfp_flower_representor *)init_params; + init_repr_data = init_params; app_fw_flower = init_repr_data->app_fw_flower; /* Memory has been allocated in the eth_dev_create() function */ diff --git a/drivers/net/nfp/nfp_common.c b/drivers/net/nfp/nfp_common.c index 634afbf1b5..b7a7296999 100644 --- a/drivers/net/nfp/nfp_common.c +++ b/drivers/net/nfp/nfp_common.c @@ -1404,7 +1404,7 @@ nfp_net_irq_unmask(struct rte_eth_dev *dev) void nfp_net_dev_interrupt_delayed_handler(void *param) { - struct rte_eth_dev *dev = (struct rte_eth_dev *)param; + struct rte_eth_dev *dev = param; nfp_net_link_update(dev, 0); rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL); @@ -1420,7 +1420,7 @@ nfp_net_dev_interrupt_handler(void *param) { int64_t timeout; struct rte_eth_link link; - struct rte_eth_dev *dev = (struct rte_eth_dev *)param; + struct rte_eth_dev *dev = param; PMD_DRV_LOG(DEBUG, "We got a LSC interrupt!!!"); @@ -1840,7 +1840,7 @@ nfp_net_stop_rx_queue(struct rte_eth_dev *dev) struct nfp_net_rxq *this_rx_q; for (i = 0; i < dev->data->nb_rx_queues; i++) { - this_rx_q = (struct nfp_net_rxq *)dev->data->rx_queues[i]; + this_rx_q = dev->data->rx_queues[i]; nfp_net_reset_rx_queue(this_rx_q); } } @@ -1852,7 +1852,7 @@ nfp_net_close_rx_queue(struct rte_eth_dev *dev) struct nfp_net_rxq *this_rx_q; for (i = 0; i < dev->data->nb_rx_queues; i++) { - this_rx_q = (struct nfp_net_rxq *)dev->data->rx_queues[i]; + this_rx_q = dev->data->rx_queues[i]; nfp_net_reset_rx_queue(this_rx_q); nfp_net_rx_queue_release(dev, i); } @@ -1865,7 +1865,7 @@ nfp_net_stop_tx_queue(struct rte_eth_dev *dev) struct nfp_net_txq *this_tx_q; for (i = 0; i < dev->data->nb_tx_queues; i++) { - this_tx_q = (struct nfp_net_txq *)dev->data->tx_queues[i]; + this_tx_q = dev->data->tx_queues[i]; nfp_net_reset_tx_queue(this_tx_q); } } @@ -1877,7 +1877,7 @@ nfp_net_close_tx_queue(struct rte_eth_dev *dev) struct nfp_net_txq *this_tx_q; for (i = 0; i < dev->data->nb_tx_queues; i++) { - this_tx_q = (struct nfp_net_txq *)dev->data->tx_queues[i]; + this_tx_q = dev->data->tx_queues[i]; nfp_net_reset_tx_queue(this_tx_q); nfp_net_tx_queue_release(dev, i); } diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c index 3a56726388..06146050ff 100644 --- a/drivers/net/nfp/nfp_ethdev.c +++ b/drivers/net/nfp/nfp_ethdev.c @@ -542,7 +542,7 @@ nfp_net_init(struct rte_eth_dev *eth_dev) pci_dev->addr.domain, pci_dev->addr.bus, pci_dev->addr.devid, pci_dev->addr.function); - hw->ctrl_bar = (uint8_t *)pci_dev->mem_resource[0].addr; + hw->ctrl_bar = pci_dev->mem_resource[0].addr; if (hw->ctrl_bar == NULL) { PMD_DRV_LOG(ERR, "hw->ctrl_bar is NULL. BAR0 not configured"); diff --git a/drivers/net/nfp/nfp_ethdev_vf.c b/drivers/net/nfp/nfp_ethdev_vf.c index f8135fa0c8..bac8df6142 100644 --- a/drivers/net/nfp/nfp_ethdev_vf.c +++ b/drivers/net/nfp/nfp_ethdev_vf.c @@ -289,7 +289,7 @@ nfp_netvf_init(struct rte_eth_dev *eth_dev) hw = NFP_NET_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private); - hw->ctrl_bar = (uint8_t *)pci_dev->mem_resource[0].addr; + hw->ctrl_bar = pci_dev->mem_resource[0].addr; if (hw->ctrl_bar == NULL) { PMD_DRV_LOG(ERR, "hw->ctrl_bar is NULL. BAR0 not configured"); diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c index fdf5c0f40e..b46acf6a39 100644 --- a/drivers/net/nfp/nfp_flow.c +++ b/drivers/net/nfp/nfp_flow.c @@ -93,7 +93,7 @@ nfp_flow_dev_to_priv(struct rte_eth_dev *dev) { struct nfp_flower_representor *repr; - repr = (struct nfp_flower_representor *)dev->data->dev_private; + repr = dev->data->dev_private; return repr->app_fw_flower->flow_priv; } @@ -726,8 +726,7 @@ nfp_flow_key_layers_calculate_items(const struct rte_flow_item items[], if (port_id->id >= RTE_MAX_ETHPORTS) return -ERANGE; ethdev = &rte_eth_devices[port_id->id]; - representor = (struct nfp_flower_representor *) - ethdev->data->dev_private; + representor = ethdev->data->dev_private; key_ls->port = rte_cpu_to_be_32(representor->port_id); break; case RTE_FLOW_ITEM_TYPE_VLAN: @@ -2047,7 +2046,7 @@ nfp_flow_action_output(char *act_data, return -ERANGE; ethdev = &rte_eth_devices[port_id->id]; - representor = (struct nfp_flower_representor *)ethdev->data->dev_private; + representor = ethdev->data->dev_private; act_size = sizeof(struct nfp_fl_act_output); output = (struct nfp_fl_act_output *)act_data; @@ -2083,7 +2082,7 @@ nfp_flow_action_set_mac(char *act_data, set_eth->head.len_lw = act_size >> NFP_FL_LW_SIZ; set_eth->reserved = 0; - set_mac = (const struct rte_flow_action_set_mac *)action->conf; + set_mac = action->conf; if (mac_src_flag) { rte_memcpy(&set_eth->eth_addr[RTE_ETHER_ADDR_LEN], set_mac->mac_addr, RTE_ETHER_ADDR_LEN); @@ -2133,7 +2132,7 @@ nfp_flow_action_set_ip(char *act_data, set_ip->head.len_lw = act_size >> NFP_FL_LW_SIZ; set_ip->reserved = 0; - set_ipv4 = (const struct rte_flow_action_set_ipv4 *)action->conf; + set_ipv4 = action->conf; if (ip_src_flag) { set_ip->ipv4_src = set_ipv4->ipv4_addr; set_ip->ipv4_src_mask = RTE_BE32(0xffffffff); @@ -2154,7 +2153,7 @@ nfp_flow_action_set_ipv6(char *act_data, const struct rte_flow_action_set_ipv6 *set_ipv6; set_ip = (struct nfp_fl_act_set_ipv6_addr *)act_data; - set_ipv6 = (const struct rte_flow_action_set_ipv6 *)action->conf; + set_ipv6 = action->conf; if (ip_src_flag) set_ip->head.jump_id = NFP_FL_ACTION_OPCODE_SET_IPV6_SRC; @@ -2191,7 +2190,7 @@ nfp_flow_action_set_tp(char *act_data, set_tp->head.len_lw = act_size >> NFP_FL_LW_SIZ; set_tp->reserved = 0; - set_tp_conf = (const struct rte_flow_action_set_tp *)action->conf; + set_tp_conf = action->conf; if (tp_src_flag) { set_tp->src_port = set_tp_conf->port; set_tp->src_port_mask = RTE_BE16(0xffff); @@ -2223,12 +2222,9 @@ nfp_flow_action_push_vlan(char *act_data, push_vlan->head.len_lw = act_size >> NFP_FL_LW_SIZ; push_vlan->reserved = 0; - push_vlan_conf = (const struct rte_flow_action_of_push_vlan *) - action->conf; - vlan_pcp_conf = (const struct rte_flow_action_of_set_vlan_pcp *) - (action + 1)->conf; - vlan_vid_conf = (const struct rte_flow_action_of_set_vlan_vid *) - (action + 2)->conf; + push_vlan_conf = action->conf; + vlan_pcp_conf = (action + 1)->conf; + vlan_vid_conf = (action + 2)->conf; vid = rte_be_to_cpu_16(vlan_vid_conf->vlan_vid) & 0x0fff; pcp = vlan_pcp_conf->vlan_pcp & 0x07; @@ -2256,7 +2252,7 @@ nfp_flow_action_set_ttl(char *act_data, ttl_tos->head.jump_id = NFP_FL_ACTION_OPCODE_SET_IPV4_TTL_TOS; ttl_tos->head.len_lw = act_size >> NFP_FL_LW_SIZ; - ttl_conf = (const struct rte_flow_action_set_ttl *)action->conf; + ttl_conf = action->conf; ttl_tos->ipv4_ttl = ttl_conf->ttl_value; ttl_tos->ipv4_ttl_mask = 0xff; ttl_tos->reserved = 0; @@ -2280,7 +2276,7 @@ nfp_flow_action_set_hl(char *act_data, tc_hl->head.jump_id = NFP_FL_ACTION_OPCODE_SET_IPV6_TC_HL_FL; tc_hl->head.len_lw = act_size >> NFP_FL_LW_SIZ; - ttl_conf = (const struct rte_flow_action_set_ttl *)action->conf; + ttl_conf = action->conf; tc_hl->ipv6_hop_limit = ttl_conf->ttl_value; tc_hl->ipv6_hop_limit_mask = 0xff; tc_hl->reserved = 0; @@ -2304,7 +2300,7 @@ nfp_flow_action_set_tos(char *act_data, ttl_tos->head.jump_id = NFP_FL_ACTION_OPCODE_SET_IPV4_TTL_TOS; ttl_tos->head.len_lw = act_size >> NFP_FL_LW_SIZ; - tos_conf = (const struct rte_flow_action_set_dscp *)action->conf; + tos_conf = action->conf; ttl_tos->ipv4_tos = tos_conf->dscp; ttl_tos->ipv4_tos_mask = 0xff; ttl_tos->reserved = 0; @@ -2328,7 +2324,7 @@ nfp_flow_action_set_tc(char *act_data, tc_hl->head.jump_id = NFP_FL_ACTION_OPCODE_SET_IPV6_TC_HL_FL; tc_hl->head.len_lw = act_size >> NFP_FL_LW_SIZ; - tos_conf = (const struct rte_flow_action_set_dscp *)action->conf; + tos_conf = action->conf; tc_hl->ipv6_tc = tos_conf->dscp; tc_hl->ipv6_tc_mask = 0xff; tc_hl->reserved = 0; @@ -2719,9 +2715,9 @@ nfp_flow_action_vxlan_encap_v4(struct nfp_app_fw_flower *app_fw_flower, size_t act_pre_size = sizeof(struct nfp_fl_act_pre_tun); size_t act_set_size = sizeof(struct nfp_fl_act_set_tun); - eth = (const struct rte_flow_item_eth *)vxlan_data->items[0].spec; - ipv4 = (const struct rte_flow_item_ipv4 *)vxlan_data->items[1].spec; - vxlan = (const struct rte_flow_item_vxlan *)vxlan_data->items[3].spec; + eth = vxlan_data->items[0].spec; + ipv4 = vxlan_data->items[1].spec; + vxlan = vxlan_data->items[3].spec; pre_tun = (struct nfp_fl_act_pre_tun *)actions; memset(pre_tun, 0, act_pre_size); @@ -2756,9 +2752,9 @@ nfp_flow_action_vxlan_encap_v6(struct nfp_app_fw_flower *app_fw_flower, size_t act_pre_size = sizeof(struct nfp_fl_act_pre_tun); size_t act_set_size = sizeof(struct nfp_fl_act_set_tun); - eth = (const struct rte_flow_item_eth *)vxlan_data->items[0].spec; - ipv6 = (const struct rte_flow_item_ipv6 *)vxlan_data->items[1].spec; - vxlan = (const struct rte_flow_item_vxlan *)vxlan_data->items[3].spec; + eth = vxlan_data->items[0].spec; + ipv6 = vxlan_data->items[1].spec; + vxlan = vxlan_data->items[3].spec; pre_tun = (struct nfp_fl_act_pre_tun *)actions; memset(pre_tun, 0, act_pre_size); @@ -3626,7 +3622,7 @@ nfp_flow_process(struct nfp_flower_representor *representor, nfp_flower_update_meta_tci(nfp_flow->payload.unmasked_data, new_mask_id); /* Calculate and store the hash_key for later use */ - hash_data = (char *)(nfp_flow->payload.unmasked_data); + hash_data = nfp_flow->payload.unmasked_data; nfp_flow->hash_key = rte_jhash(hash_data, nfp_flow->length, priv->hash_seed); /* Find the flow in hash table */ @@ -3716,7 +3712,7 @@ nfp_flow_validate(struct rte_eth_dev *dev, struct nfp_flow_priv *priv; struct nfp_flower_representor *representor; - representor = (struct nfp_flower_representor *)dev->data->dev_private; + representor = dev->data->dev_private; priv = representor->app_fw_flower->flow_priv; nfp_flow = nfp_flow_setup(representor, attr, items, actions, error, true); @@ -3751,7 +3747,7 @@ nfp_flow_create(struct rte_eth_dev *dev, struct nfp_app_fw_flower *app_fw_flower; struct nfp_flower_representor *representor; - representor = (struct nfp_flower_representor *)dev->data->dev_private; + representor = dev->data->dev_private; app_fw_flower = representor->app_fw_flower; priv = app_fw_flower->flow_priv; @@ -3813,7 +3809,7 @@ nfp_flow_destroy(struct rte_eth_dev *dev, struct nfp_app_fw_flower *app_fw_flower; struct nfp_flower_representor *representor; - representor = (struct nfp_flower_representor *)dev->data->dev_private; + representor = dev->data->dev_private; app_fw_flower = representor->app_fw_flower; priv = app_fw_flower->flow_priv; @@ -3949,7 +3945,7 @@ nfp_flow_stats_get(struct rte_eth_dev *dev, return; } - query = (struct rte_flow_query_count *)data; + query = data; reset = query->reset; memset(query, 0, sizeof(*query)); diff --git a/drivers/net/nfp/nfp_rxtx.c b/drivers/net/nfp/nfp_rxtx.c index 2409f63205..3c78557221 100644 --- a/drivers/net/nfp/nfp_rxtx.c +++ b/drivers/net/nfp/nfp_rxtx.c @@ -630,7 +630,7 @@ nfp_net_rx_queue_setup(struct rte_eth_dev *dev, /* Saving physical and virtual addresses for the RX ring */ rxq->dma = (uint64_t)tz->iova; - rxq->rxds = (struct nfp_net_rx_desc *)tz->addr; + rxq->rxds = tz->addr; /* mbuf pointers array for referencing mbufs linked to RX descriptors */ rxq->rxbufs = rte_zmalloc_socket("rxq->rxbufs", diff --git a/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c b/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c index edf4088747..9d63e0ee73 100644 --- a/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c +++ b/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c @@ -835,7 +835,7 @@ nfp6000_init(struct nfp_cpp *cpp, struct rte_pci_device *dev) if (nfp6000_set_barsz(dev, desc) < 0) goto error; - desc->cfg = (char *)dev->mem_resource[0].addr; + desc->cfg = dev->mem_resource[0].addr; nfp_enable_bars(desc); -- 2.39.1