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: sta...@dpdk.org Signed-off-by: Bruce Richardson <bruce.richard...@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