From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org
Cc: Bruce Richardson <bruce.richardson@intel.com>,
stable@dpdk.org, Anatoly Burakov <anatoly.burakov@intel.com>,
Vladimir Medvedkin <vladimir.medvedkin@intel.com>,
Piotr Kwapulinski <piotr.kwapulinski@intel.com>,
Jedrzej Jagielski <jedrzej.jagielski@intel.com>,
Stefan Wegrzyn <stefan.wegrzyn@intel.com>
Subject: [PATCH v3 4/9] net/ixgbe/base: fix compilation warnings
Date: Thu, 27 Mar 2025 14:51:56 +0000 [thread overview]
Message-ID: <20250327145202.2220153-5-bruce.richardson@intel.com> (raw)
In-Reply-To: <20250327145202.2220153-1-bruce.richardson@intel.com>
We can remove almost all of the "unused parameter" and "unused variable"
warnings by just improving the macro definitions in the osdep.h header.
Remaining two instances can be fixed by just one-line additions to the
code, so add those to give us a clean build with the warnings enabled.
Fixes: af75078fece3 ("first public release")
Fixes: c6cb313da739 ("net/ixgbe/base: add link management for E610")
Cc: stable@dpdk.org
Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
drivers/net/intel/ixgbe/base/ixgbe_e610.c | 2 ++
drivers/net/intel/ixgbe/base/ixgbe_osdep.h | 19 +++++++++++--------
drivers/net/intel/ixgbe/base/meson.build | 11 -----------
3 files changed, 13 insertions(+), 19 deletions(-)
diff --git a/drivers/net/intel/ixgbe/base/ixgbe_e610.c b/drivers/net/intel/ixgbe/base/ixgbe_e610.c
index 5474c3012a..7420c78d07 100644
--- a/drivers/net/intel/ixgbe/base/ixgbe_e610.c
+++ b/drivers/net/intel/ixgbe/base/ixgbe_e610.c
@@ -1054,6 +1054,7 @@ static void ixgbe_parse_vsi_func_caps(struct ixgbe_hw *hw,
struct ixgbe_hw_func_caps *func_p,
struct ixgbe_aci_cmd_list_caps_elem *cap)
{
+ UNREFERENCED_PARAMETER(cap);
func_p->guar_num_vsi = ixgbe_get_num_per_func(hw, IXGBE_MAX_VSI);
}
@@ -1770,6 +1771,7 @@ s32 ixgbe_aci_set_event_mask(struct ixgbe_hw *hw, u8 port_num, u16 mask)
struct ixgbe_aci_cmd_set_event_mask *cmd;
struct ixgbe_aci_desc desc;
+ UNREFERENCED_PARAMETER(port_num);
cmd = &desc.params.set_event_mask;
ixgbe_fill_dflt_direct_cmd_desc(&desc, ixgbe_aci_opc_set_event_mask);
diff --git a/drivers/net/intel/ixgbe/base/ixgbe_osdep.h b/drivers/net/intel/ixgbe/base/ixgbe_osdep.h
index 6e5f7b4ae8..398c38bffd 100644
--- a/drivers/net/intel/ixgbe/base/ixgbe_osdep.h
+++ b/drivers/net/intel/ixgbe/base/ixgbe_osdep.h
@@ -57,13 +57,16 @@
/* Bunch of defines for shared code bogosity */
#ifndef UNREFERENCED_PARAMETER
-#define UNREFERENCED_PARAMETER(_p)
+#define UNREFERENCED_PARAMETER(_p) (void)(_p)
#endif
-#define UNREFERENCED_1PARAMETER(_p)
-#define UNREFERENCED_2PARAMETER(_p, _q)
-#define UNREFERENCED_3PARAMETER(_p, _q, _r)
-#define UNREFERENCED_4PARAMETER(_p, _q, _r, _s)
-#define UNREFERENCED_5PARAMETER(_p, _q, _r, _s, _t)
+#define UNREFERENCED_1PARAMETER(_p) (void)(_p)
+#define UNREFERENCED_2PARAMETER(_p, _q) do { (void)(_p); (void)(_q); } while(0)
+#define UNREFERENCED_3PARAMETER(_p, _q, _r) \
+ do { (void)(_p); (void)(_q); (void)(_r); } while(0)
+#define UNREFERENCED_4PARAMETER(_p, _q, _r, _s) \
+ do { (void)(_p); (void)(_q); (void)(_r); (void)(_s); } while(0)
+#define UNREFERENCED_5PARAMETER(_p, _q, _r, _s, _t) \
+ do { (void)(_p); (void)(_q); (void)(_r); (void)(_s); (void)(_t); } while(0)
/* Shared code error reporting */
enum {
@@ -130,8 +133,8 @@ static inline uint32_t ixgbe_read_addr(volatile void* addr)
IXGBE_PCI_REG_ADDR((hw), (reg) + ((index) << 2))
/* Not implemented !! */
-#define IXGBE_READ_PCIE_WORD(hw, reg) 0
-#define IXGBE_WRITE_PCIE_WORD(hw, reg, value) do { } while(0)
+#define IXGBE_READ_PCIE_WORD(hw, reg) ((void)hw, (void)(reg), 0)
+#define IXGBE_WRITE_PCIE_WORD(hw, reg, value) do { (void)hw; (void)reg; (void)value; } while(0)
#define IXGBE_WRITE_FLUSH(a) IXGBE_READ_REG(a, IXGBE_STATUS)
diff --git a/drivers/net/intel/ixgbe/base/meson.build b/drivers/net/intel/ixgbe/base/meson.build
index f8b2ee6341..64e0bfd7be 100644
--- a/drivers/net/intel/ixgbe/base/meson.build
+++ b/drivers/net/intel/ixgbe/base/meson.build
@@ -19,17 +19,6 @@ sources = [
'ixgbe_x550.c',
]
-error_cflags = [
- '-Wno-unused-but-set-variable',
- '-Wno-unused-parameter',
- ]
-c_args = cflags
-foreach flag: error_cflags
- if cc.has_argument(flag)
- c_args += flag
- endif
-endforeach
-
base_lib = static_library('ixgbe_base', sources,
dependencies: [static_rte_eal, static_rte_net],
c_args: c_args)
--
2.45.2
next prev parent reply other threads:[~2025-03-27 14:52 UTC|newest]
Thread overview: 55+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-26 15:52 [PATCH 0/7] net/intel: clean up base code build Bruce Richardson
2025-03-26 15:52 ` [PATCH 1/7] net/iavf/base: remove unused meson.build file Bruce Richardson
2025-03-26 15:52 ` [PATCH 2/7] net/ixgbe/base: correct definition of macro Bruce Richardson
2025-03-26 15:52 ` [PATCH 3/7] net/ixgbe/base: fix compilation warnings Bruce Richardson
2025-03-26 15:52 ` [PATCH 4/7] net/i40e/base: fix unused value warnings Bruce Richardson
2025-03-26 15:52 ` [PATCH 5/7] net/i40e/base: fix compiler warnings Bruce Richardson
2025-03-26 15:52 ` [PATCH 6/7] net/ice/base: reduce warnings for unused variables Bruce Richardson
2025-03-26 15:52 ` [PATCH 7/7] net/intel: simplify base code builds Bruce Richardson
2025-03-26 16:05 ` [PATCH v2 0/8] net/intel: clean up base code build Bruce Richardson
2025-03-26 16:05 ` [PATCH v2 1/8] net/fm10k/base: fix compilation warnings Bruce Richardson
2025-03-26 16:05 ` [PATCH v2 2/8] net/iavf/base: remove unused meson.build file Bruce Richardson
2025-03-26 16:05 ` [PATCH v2 3/8] net/ixgbe/base: correct definition of macro Bruce Richardson
2025-03-26 16:05 ` [PATCH v2 4/8] net/ixgbe/base: fix compilation warnings Bruce Richardson
2025-03-26 16:05 ` [PATCH v2 5/8] net/i40e/base: fix unused value warnings Bruce Richardson
2025-03-26 16:05 ` [PATCH v2 6/8] net/i40e/base: fix compiler warnings Bruce Richardson
2025-03-26 16:05 ` [PATCH v2 7/8] net/ice/base: reduce warnings for unused variables Bruce Richardson
2025-03-26 16:05 ` [PATCH v2 8/8] net/intel: simplify base code builds Bruce Richardson
2025-03-27 14:51 ` [PATCH v3 0/9] net/intel: clean up base code build Bruce Richardson
2025-03-27 14:51 ` [PATCH v3 1/9] net/fm10k/base: fix compilation warnings Bruce Richardson
2025-03-27 14:51 ` [PATCH v3 2/9] net/iavf/base: remove unused meson.build file Bruce Richardson
2025-03-27 14:51 ` [PATCH v3 3/9] net/ixgbe/base: correct definition of macro Bruce Richardson
2025-03-27 14:51 ` Bruce Richardson [this message]
2025-03-27 14:51 ` [PATCH v3 5/9] net/ixgbe/base: fix lock checker errors Bruce Richardson
2025-03-28 8:20 ` David Marchand
2025-03-28 10:43 ` Bruce Richardson
2025-03-28 11:13 ` Bruce Richardson
2025-03-28 11:48 ` David Marchand
2025-03-27 14:51 ` [PATCH v3 6/9] net/i40e/base: fix unused value warnings Bruce Richardson
2025-03-27 14:51 ` [PATCH v3 7/9] net/i40e/base: fix compiler warnings Bruce Richardson
2025-03-27 14:52 ` [PATCH v3 8/9] net/ice/base: reduce warnings for unused variables Bruce Richardson
2025-03-27 14:52 ` [PATCH v3 9/9] net/intel: simplify base code builds Bruce Richardson
2025-03-28 8:21 ` [PATCH v3 0/9] net/intel: clean up base code build David Marchand
2025-03-28 9:01 ` Bruce Richardson
2025-03-28 11:16 ` [PATCH v4 " Bruce Richardson
2025-03-28 11:16 ` [PATCH v4 1/9] net/fm10k/base: fix compilation warnings Bruce Richardson
2025-03-28 12:53 ` Burakov, Anatoly
2025-03-28 11:16 ` [PATCH v4 2/9] net/iavf/base: remove unused meson.build file Bruce Richardson
2025-03-28 13:00 ` Burakov, Anatoly
2025-03-28 11:16 ` [PATCH v4 3/9] net/ixgbe/base: correct definition of macro Bruce Richardson
2025-03-28 13:01 ` Burakov, Anatoly
2025-03-28 11:16 ` [PATCH v4 4/9] net/ixgbe/base: fix compilation warnings Bruce Richardson
2025-03-28 13:02 ` Burakov, Anatoly
2025-03-28 11:16 ` [PATCH v4 5/9] net/ixgbe/base: fix lock checker errors Bruce Richardson
2025-03-28 13:05 ` Burakov, Anatoly
2025-03-28 11:16 ` [PATCH v4 6/9] net/i40e/base: fix unused value warnings Bruce Richardson
2025-03-28 13:07 ` Burakov, Anatoly
2025-03-28 15:21 ` Andre Muezerie
2025-03-28 15:26 ` Bruce Richardson
2025-03-28 11:16 ` [PATCH v4 7/9] net/i40e/base: fix compiler warnings Bruce Richardson
2025-03-28 13:08 ` Burakov, Anatoly
2025-03-28 11:16 ` [PATCH v4 8/9] net/ice/base: reduce warnings for unused variables Bruce Richardson
2025-03-28 13:09 ` Burakov, Anatoly
2025-03-28 11:16 ` [PATCH v4 9/9] net/intel: simplify base code builds Bruce Richardson
2025-03-28 13:09 ` Burakov, Anatoly
2025-03-28 16:05 ` [PATCH v4 0/9] net/intel: clean up base code build Bruce Richardson
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=20250327145202.2220153-5-bruce.richardson@intel.com \
--to=bruce.richardson@intel.com \
--cc=anatoly.burakov@intel.com \
--cc=dev@dpdk.org \
--cc=jedrzej.jagielski@intel.com \
--cc=piotr.kwapulinski@intel.com \
--cc=stable@dpdk.org \
--cc=stefan.wegrzyn@intel.com \
--cc=vladimir.medvedkin@intel.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).