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 4714745F4B; Thu, 26 Dec 2024 19:41:54 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E2786402D7; Thu, 26 Dec 2024 19:41:49 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 1E3A3402AF for ; Thu, 26 Dec 2024 19:41:48 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1213) id 24C13203EC22; Thu, 26 Dec 2024 10:41:47 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 24C13203EC22 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1735238507; bh=OYi0KGuJDYN+OaZN97AtQ9zLH/cWAtt2TTc5QFPmmZ4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hXjm4eElhPTLbhXnZ6J71cI9emR+72BO5frmdAlqH4Rcznm1Lyua2YzrAsoWVas1Q 9v0hJ+UdEH4QZ/KCUPDOYe4zfXWopZlbhrXWQ6SeaI4kEDa0tcAysK8qnP1zYnet30 eMVcd0pR+bf6IjhuiH8eLcMDbFJvVb8PcD9X/lfw= From: Andre Muezerie To: Jingjing Wu , Praveen Shetty , Andrew Rybchenko Cc: dev@dpdk.org, Andre Muezerie Subject: [PATCH 1/2] drivers/common: remove unused variables and add MSVC compiler flag Date: Thu, 26 Dec 2024 10:41:43 -0800 Message-Id: <1735238504-15597-2-git-send-email-andremue@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1735238504-15597-1-git-send-email-andremue@linux.microsoft.com> References: <1735238504-15597-1-git-send-email-andremue@linux.microsoft.com> 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 Removed unused variables and added MSVC specific compiler flag to ignore warnings about unused variables, like is being done for other compilers. Signed-off-by: Andre Muezerie --- drivers/common/idpf/base/meson.build | 13 ++++++++++--- drivers/common/idpf/idpf_common_rxtx.c | 2 -- drivers/common/idpf/idpf_common_virtchnl.c | 4 ++-- drivers/common/sfc_efx/base/efx_mae.c | 2 +- drivers/common/sfc_efx/base/efx_table.c | 1 - drivers/common/sfc_efx/base/meson.build | 20 +++++++++++++------- 6 files changed, 26 insertions(+), 16 deletions(-) diff --git a/drivers/common/idpf/base/meson.build b/drivers/common/idpf/base/meson.build index f30ec7dfc2..c069507f12 100644 --- a/drivers/common/idpf/base/meson.build +++ b/drivers/common/idpf/base/meson.build @@ -6,9 +6,16 @@ sources += files( 'idpf_controlq_setup.c', ) -error_cflags = [ - '-Wno-unused-variable', -] +if is_ms_compiler + error_cflags = [ + '/wd4101', # unreferenced local variable + ] +else + error_cflags = [ + '-Wno-unused-variable', + ] +endif + foreach flag: error_cflags if cc.has_argument(flag) cflags += flag diff --git a/drivers/common/idpf/idpf_common_rxtx.c b/drivers/common/idpf/idpf_common_rxtx.c index a04e54ce26..9b17279181 100644 --- a/drivers/common/idpf/idpf_common_rxtx.c +++ b/drivers/common/idpf/idpf_common_rxtx.c @@ -1178,7 +1178,6 @@ idpf_dp_singleq_recv_scatter_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, struct rte_mbuf *last_seg = rxq->pkt_last_seg; struct rte_mbuf *rxm; struct rte_mbuf *nmb; - struct rte_eth_dev *dev; const uint32_t *ptype_tbl = rxq->adapter->ptype_tbl; uint16_t rx_id = rxq->rx_tail; uint16_t rx_packet_len; @@ -1310,7 +1309,6 @@ idpf_xmit_cleanup(struct idpf_tx_queue *txq) uint16_t nb_tx_desc = txq->nb_tx_desc; uint16_t desc_to_clean_to; uint16_t nb_tx_to_clean; - uint16_t i; volatile struct idpf_base_tx_desc *txd = txq->tx_ring; diff --git a/drivers/common/idpf/idpf_common_virtchnl.c b/drivers/common/idpf/idpf_common_virtchnl.c index de511da788..0ae1d55d79 100644 --- a/drivers/common/idpf/idpf_common_virtchnl.c +++ b/drivers/common/idpf/idpf_common_virtchnl.c @@ -362,7 +362,7 @@ idpf_vc_queue_grps_add(struct idpf_vport *vport, { struct idpf_adapter *adapter = vport->adapter; struct idpf_cmd_info args; - int size, qg_info_size; + int size; int err = -1; size = sizeof(*p2p_queue_grps_info) + @@ -1044,7 +1044,7 @@ int idpf_vc_rxq_config_by_info(struct idpf_vport *vport, struct virtchnl2_rxq_in struct idpf_adapter *adapter = vport->adapter; struct virtchnl2_config_rx_queues *vc_rxqs = NULL; struct idpf_cmd_info args; - int size, err, i; + int size, err; size = sizeof(*vc_rxqs) + (num_qs - 1) * sizeof(struct virtchnl2_rxq_info); diff --git a/drivers/common/sfc_efx/base/efx_mae.c b/drivers/common/sfc_efx/base/efx_mae.c index 9ae136dcce..1429e7dd0a 100644 --- a/drivers/common/sfc_efx/base/efx_mae.c +++ b/drivers/common/sfc_efx/base/efx_mae.c @@ -740,7 +740,6 @@ efx_mae_mport_by_pcie_function( __in uint32_t vf, __out efx_mport_sel_t *mportp) { - efx_dword_t dword; efx_rc_t rc; rc = efx_mae_mport_by_pcie_mh_function(EFX_PCIE_INTERFACE_CALLER, @@ -4280,6 +4279,7 @@ efx_mae_action_set_replay( __out efx_mae_actions_t **spec_clonep) { const efx_nic_cfg_t *encp = efx_nic_cfg_get(enp); + (void)encp; efx_mae_actions_t *spec_clone; efx_rc_t rc; diff --git a/drivers/common/sfc_efx/base/efx_table.c b/drivers/common/sfc_efx/base/efx_table.c index 13a12a116e..50e9a37d1c 100644 --- a/drivers/common/sfc_efx/base/efx_table.c +++ b/drivers/common/sfc_efx/base/efx_table.c @@ -240,7 +240,6 @@ efx_table_describe( const efx_nic_cfg_t *encp = efx_nic_cfg_get(enp); unsigned int n_entries; efx_mcdi_req_t req; - unsigned int i; efx_rc_t rc; EFX_MCDI_DECLARE_BUF(payload, MC_CMD_TABLE_DESCRIPTOR_IN_LEN, diff --git a/drivers/common/sfc_efx/base/meson.build b/drivers/common/sfc_efx/base/meson.build index 7fc04aa57b..c8deb4555e 100644 --- a/drivers/common/sfc_efx/base/meson.build +++ b/drivers/common/sfc_efx/base/meson.build @@ -66,13 +66,19 @@ sources = [ 'rhead_virtio.c', ] -extra_flags = [ - '-Wno-sign-compare', - '-Wno-unused-parameter', - '-Wno-unused-variable', - '-Wno-empty-body', - '-Wno-unused-but-set-variable', -] +if is_ms_compiler + extra_flags = [ + '/wd4101', # unreferenced local variable + ] +else + extra_flags = [ + '-Wno-sign-compare', + '-Wno-unused-parameter', + '-Wno-unused-variable', + '-Wno-empty-body', + '-Wno-unused-but-set-variable', + ] +endif c_args = cflags foreach flag: extra_flags -- 2.47.0.vfs.0.3