DPDK patches and discussions
 help / color / mirror / Atom feed
From: Andre Muezerie <andremue@linux.microsoft.com>
To: Bruce Richardson <bruce.richardson@intel.com>,
	Anatoly Burakov <anatoly.burakov@intel.com>,
	Devendra Singh Rawat <dsinghrawat@marvell.com>,
	Alok Prasad <palok@marvell.com>
Cc: dev@dpdk.org, Andre Muezerie <andremue@linux.microsoft.com>
Subject: [PATCH 2/2] drivers/net: remove unused variables and add MSVC compiler flag
Date: Thu, 26 Dec 2024 10:41:44 -0800	[thread overview]
Message-ID: <1735238504-15597-3-git-send-email-andremue@linux.microsoft.com> (raw)
In-Reply-To: <1735238504-15597-1-git-send-email-andremue@linux.microsoft.com>

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 <andremue@linux.microsoft.com>
---
 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


      parent reply	other threads:[~2024-12-26 18:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-26 18:41 [PATCH 0/2] " Andre Muezerie
2024-12-26 18:41 ` [PATCH 1/2] drivers/common: " Andre Muezerie
2024-12-26 18:41 ` Andre Muezerie [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1735238504-15597-3-git-send-email-andremue@linux.microsoft.com \
    --to=andremue@linux.microsoft.com \
    --cc=anatoly.burakov@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=dsinghrawat@marvell.com \
    --cc=palok@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).