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 0AAF545F4B; Thu, 26 Dec 2024 19:42:00 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1825A402E1; Thu, 26 Dec 2024 19:41:51 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 24F29402B2 for ; Thu, 26 Dec 2024 19:41:48 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1213) id 4D712203EC23; Thu, 26 Dec 2024 10:41:47 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 4D712203EC23 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1735238507; bh=cDfobG3jt8vTPAZQMh+y7XsbinBvUDSon0A/SnhLkH8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LgJT47E9JlOZOVi19da5ZtU2Xg4rdKophTE18qXBBFkXZBQLdd6vNB6H2qJ9bBg/v cv5LjakT351KIWIikHt6LwKKC2TNmF/wUVxGPY4gBiqAe2PqnfN2lLFp1z6kOfapIX iQBc9qKvqoCxbUtx9TXd8Uxvg3RU/spPcnEx2+x8= From: Andre Muezerie To: Bruce Richardson , Anatoly Burakov , Devendra Singh Rawat , Alok Prasad Cc: dev@dpdk.org, Andre Muezerie Subject: [PATCH 2/2] drivers/net: remove unused variables and add MSVC compiler flag Date: Thu, 26 Dec 2024 10:41:44 -0800 Message-Id: <1735238504-15597-3-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/net/ice/base/ice_switch.c | 2 -- drivers/net/ice/base/meson.build | 16 ++++++--- drivers/net/qede/base/ecore_dcbx.c | 2 -- drivers/net/qede/base/ecore_mcp.c | 2 -- drivers/net/qede/base/meson.build | 57 +++++++++++++++++------------- 5 files changed, 43 insertions(+), 36 deletions(-) diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c index a3786961e6..468a9f055d 100644 --- a/drivers/net/ice/base/ice_switch.c +++ b/drivers/net/ice/base/ice_switch.c @@ -8190,7 +8190,6 @@ ice_add_adv_recipe(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups, struct ice_sw_recipe *rm; u8 i; int status = ICE_SUCCESS; - u16 cnt; if (!ice_is_prof_rule(rinfo->tun_type) && !lkups_cnt) return ICE_ERR_PARAM; @@ -9795,7 +9794,6 @@ ice_rem_adv_rule(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups, bool remove_rule = false; struct ice_lock *rule_lock; /* Lock to protect filter rule list */ u16 i, rid, vsi_handle; - bool is_add = false; int status = ICE_SUCCESS; ice_memset(&lkup_exts, 0, sizeof(lkup_exts), ICE_NONDMA_MEM); diff --git a/drivers/net/ice/base/meson.build b/drivers/net/ice/base/meson.build index addb922ac9..a291d05b93 100644 --- a/drivers/net/ice/base/meson.build +++ b/drivers/net/ice/base/meson.build @@ -31,11 +31,17 @@ sources = [ 'ice_vf_mbx.c', ] -error_cflags = [ - '-Wno-unused-but-set-variable', - '-Wno-unused-variable', - '-Wno-unused-parameter', -] +if is_ms_compiler + error_cflags = [ + '/wd4101', # unreferenced local variable + ] +else + error_cflags = [ + '-Wno-unused-but-set-variable', + '-Wno-unused-variable', + '-Wno-unused-parameter', + ] +endif # Bugzilla ID: 678 if (toolchain == 'gcc' and cc.version().version_compare('>=11.0.0')) diff --git a/drivers/net/qede/base/ecore_dcbx.c b/drivers/net/qede/base/ecore_dcbx.c index 31234f18cf..dc4f17ccbb 100644 --- a/drivers/net/qede/base/ecore_dcbx.c +++ b/drivers/net/qede/base/ecore_dcbx.c @@ -421,8 +421,6 @@ ecore_dcbx_get_priority_info(struct ecore_hwfn *p_hwfn, struct ecore_dcbx_app_prio *p_prio, struct ecore_dcbx_results *p_results) { - u8 val; - if (p_results->arr[DCBX_PROTOCOL_ETH].update && p_results->arr[DCBX_PROTOCOL_ETH].enable) p_prio->eth = p_results->arr[DCBX_PROTOCOL_ETH].priority; diff --git a/drivers/net/qede/base/ecore_mcp.c b/drivers/net/qede/base/ecore_mcp.c index ec83b244e6..ccd56a45d9 100644 --- a/drivers/net/qede/base/ecore_mcp.c +++ b/drivers/net/qede/base/ecore_mcp.c @@ -1193,7 +1193,6 @@ enum _ecore_status_t ecore_mcp_unload_done(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt) { struct ecore_mcp_mb_params mb_params; - struct mcp_mac wol_mac; OSAL_MEM_ZERO(&mb_params, sizeof(mb_params)); mb_params.cmd = DRV_MSG_CODE_UNLOAD_DONE; @@ -2531,7 +2530,6 @@ ecore_mcp_get_shmem_proto_mfw(struct ecore_hwfn *p_hwfn, enum ecore_pci_personality *p_proto) { u32 resp = 0, param = 0; - enum _ecore_status_t rc; DP_VERBOSE(p_hwfn, ECORE_MSG_IFUP, "According to capabilities, L2 personality is %08x [resp %08x param %08x]\n", diff --git a/drivers/net/qede/base/meson.build b/drivers/net/qede/base/meson.build index 4ad177b478..66251360bf 100644 --- a/drivers/net/qede/base/meson.build +++ b/drivers/net/qede/base/meson.build @@ -19,31 +19,38 @@ sources = [ ] -error_cflags = [ - '-Wno-unused-parameter', - '-Wno-sign-compare', - '-Wno-missing-prototypes', - '-Wno-cast-qual', - '-Wno-unused-function', - '-Wno-unused-variable', - '-Wno-strict-aliasing', - '-Wno-missing-prototypes', - '-Wno-unused-value', - '-Wno-format-nonliteral', - '-Wno-shift-negative-value', - '-Wno-unused-but-set-variable', - '-Wno-missing-declarations', - '-Wno-maybe-uninitialized', - '-Wno-strict-prototypes', - '-Wno-shift-negative-value', - '-Wno-implicit-fallthrough', - '-Wno-format-extra-args', - '-Wno-visibility', - '-Wno-empty-body', - '-Wno-invalid-source-encoding', - '-Wno-sometimes-uninitialized', - '-Wno-pointer-bool-conversion', -] +if is_ms_compiler + error_cflags = [ + '/wd4101', # unreferenced local variable + ] +else + error_cflags = [ + '-Wno-unused-parameter', + '-Wno-sign-compare', + '-Wno-missing-prototypes', + '-Wno-cast-qual', + '-Wno-unused-function', + '-Wno-unused-variable', + '-Wno-strict-aliasing', + '-Wno-missing-prototypes', + '-Wno-unused-value', + '-Wno-format-nonliteral', + '-Wno-shift-negative-value', + '-Wno-unused-but-set-variable', + '-Wno-missing-declarations', + '-Wno-maybe-uninitialized', + '-Wno-strict-prototypes', + '-Wno-shift-negative-value', + '-Wno-implicit-fallthrough', + '-Wno-format-extra-args', + '-Wno-visibility', + '-Wno-empty-body', + '-Wno-invalid-source-encoding', + '-Wno-sometimes-uninitialized', + '-Wno-pointer-bool-conversion', + ] +endif + c_args = cflags foreach flag: error_cflags if cc.has_argument(flag) -- 2.47.0.vfs.0.3