All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org
Cc: Bruce Richardson <bruce.richardson@intel.com>,
	stable@dpdk.org, Jing Chen <jing.d.chen@intel.com>
Subject: [PATCH v3 1/9] net/fm10k/base: fix compilation warnings
Date: Thu, 27 Mar 2025 14:51:53 +0000	[thread overview]
Message-ID: <20250327145202.2220153-2-bruce.richardson@intel.com> (raw)
In-Reply-To: <20250327145202.2220153-1-bruce.richardson@intel.com>

The fixes required to re-enable warnings in the fm10k base code are
trivial, so let's make the changes and get a clean compile without any
warning disable flags.

* provide definitions for the UNREFERENCED_PARAMETER macros
* fix the spelling of the work "fallthrough" in comments
* provide a definition of FM10K_READ_PCI_WORD in os_dep.h that marks the
  parameters as used.

Fixes: 7223d200c227 ("fm10k: add base driver")
Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/net/intel/fm10k/base/fm10k_mbx.c   |  2 +-
 drivers/net/intel/fm10k/base/fm10k_osdep.h |  2 +-
 drivers/net/intel/fm10k/base/fm10k_pf.c    |  8 ++++----
 drivers/net/intel/fm10k/base/fm10k_type.h  |  6 +++---
 drivers/net/intel/fm10k/base/meson.build   | 14 +-------------
 5 files changed, 10 insertions(+), 22 deletions(-)

diff --git a/drivers/net/intel/fm10k/base/fm10k_mbx.c b/drivers/net/intel/fm10k/base/fm10k_mbx.c
index 2bb0d82efe..9028403757 100644
--- a/drivers/net/intel/fm10k/base/fm10k_mbx.c
+++ b/drivers/net/intel/fm10k/base/fm10k_mbx.c
@@ -1602,7 +1602,7 @@ s32 fm10k_pfvf_mbx_init(struct fm10k_hw *hw, struct fm10k_mbx_info *mbx,
 			mbx->mbmem_reg = FM10K_MBMEM_VF(id, 0);
 			break;
 		}
-		/* fallthough */
+		/* fallthrough */
 	default:
 		return FM10K_MBX_ERR_NO_MBX;
 	}
diff --git a/drivers/net/intel/fm10k/base/fm10k_osdep.h b/drivers/net/intel/fm10k/base/fm10k_osdep.h
index a727a57481..5f8ff10474 100644
--- a/drivers/net/intel/fm10k/base/fm10k_osdep.h
+++ b/drivers/net/intel/fm10k/base/fm10k_osdep.h
@@ -67,7 +67,7 @@ typedef uint64_t   u64;
 #define FM10K_PCI_REG_WRITE(reg, value) rte_write32((value), (reg))
 
 /* not implemented */
-#define FM10K_READ_PCI_WORD(hw, reg)     0
+#define FM10K_READ_PCI_WORD(hw, reg)     ((void)hw, (void)reg, 0)
 
 #define FM10K_WRITE_MBX(hw, reg, value) FM10K_WRITE_REG(hw, reg, value)
 #define FM10K_READ_MBX(hw, reg) FM10K_READ_REG(hw, reg)
diff --git a/drivers/net/intel/fm10k/base/fm10k_pf.c b/drivers/net/intel/fm10k/base/fm10k_pf.c
index 439dd224de..b54116a4b5 100644
--- a/drivers/net/intel/fm10k/base/fm10k_pf.c
+++ b/drivers/net/intel/fm10k/base/fm10k_pf.c
@@ -1362,19 +1362,19 @@ STATIC u8 fm10k_iov_supported_xcast_mode_pf(struct fm10k_vf_info *vf_info,
 	case FM10K_XCAST_MODE_PROMISC:
 		if (vf_flags & FM10K_VF_FLAG_PROMISC_CAPABLE)
 			return FM10K_XCAST_MODE_PROMISC;
-		/* fallthough */
+		/* fallthrough */
 	case FM10K_XCAST_MODE_ALLMULTI:
 		if (vf_flags & FM10K_VF_FLAG_ALLMULTI_CAPABLE)
 			return FM10K_XCAST_MODE_ALLMULTI;
-		/* fallthough */
+		/* fallthrough */
 	case FM10K_XCAST_MODE_MULTI:
 		if (vf_flags & FM10K_VF_FLAG_MULTI_CAPABLE)
 			return FM10K_XCAST_MODE_MULTI;
-		/* fallthough */
+		/* fallthrough */
 	case FM10K_XCAST_MODE_NONE:
 		if (vf_flags & FM10K_VF_FLAG_NONE_CAPABLE)
 			return FM10K_XCAST_MODE_NONE;
-		/* fallthough */
+		/* fallthrough */
 	default:
 		break;
 	}
diff --git a/drivers/net/intel/fm10k/base/fm10k_type.h b/drivers/net/intel/fm10k/base/fm10k_type.h
index 84781ba9b2..437fb1c55e 100644
--- a/drivers/net/intel/fm10k/base/fm10k_type.h
+++ b/drivers/net/intel/fm10k/base/fm10k_type.h
@@ -83,9 +83,9 @@ struct fm10k_hw;
 #define FM10K_NOT_IMPLEMENTED			0x7FFFFFFF
 
 #define UNREFERENCED_XPARAMETER
-#define UNREFERENCED_1PARAMETER(_p) (_p)
-#define UNREFERENCED_2PARAMETER(_p, _q)	    do { (_p); (_q); } while (0)
-#define UNREFERENCED_3PARAMETER(_p, _q, _r) do { (_p); (_q); (_r); } while (0)
+#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)
 
 /* Start of PF registers */
 #define FM10K_CTRL		0x0000
diff --git a/drivers/net/intel/fm10k/base/meson.build b/drivers/net/intel/fm10k/base/meson.build
index f24e453fd0..a2640d1ee8 100644
--- a/drivers/net/intel/fm10k/base/meson.build
+++ b/drivers/net/intel/fm10k/base/meson.build
@@ -10,19 +10,7 @@ sources = [
         'fm10k_vf.c',
 ]
 
-error_cflags = [
-        '-Wno-unused-parameter',
-        '-Wno-unused-value',
-        '-Wno-implicit-fallthrough',
-]
-c_args = cflags
-foreach flag: error_cflags
-    if cc.has_argument(flag)
-        c_args += flag
-    endif
-endforeach
-
 base_lib = static_library('fm10k_base', sources,
     dependencies: static_rte_eal,
-    c_args: c_args)
+    c_args: cflags)
 base_objs = base_lib.extract_all_objects(recursive: true)
-- 
2.45.2


  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   ` Bruce Richardson [this message]
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   ` [PATCH v3 4/9] net/ixgbe/base: fix compilation warnings Bruce Richardson
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-2-bruce.richardson@intel.com \
    --to=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=jing.d.chen@intel.com \
    --cc=stable@dpdk.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.