Fix warnings about unused values - parameters, variables, etc., and remove the warning disable flags for them. Although modifying the base-code files is not ideal, the changes required are minor, and only affect two files from the imported base code.
Fixes: 8db9e2a1b232 ("i40e: base driver") Cc: sta...@dpdk.org Signed-off-by: Bruce Richardson <bruce.richard...@intel.com> --- drivers/net/intel/i40e/base/i40e_nvm.c | 2 +- drivers/net/intel/i40e/base/i40e_osdep.h | 4 ++-- drivers/net/intel/i40e/base/i40e_type.h | 14 +++++++++----- drivers/net/intel/i40e/base/meson.build | 3 --- drivers/net/intel/i40e/i40e_ethdev.c | 1 + 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/drivers/net/intel/i40e/base/i40e_nvm.c b/drivers/net/intel/i40e/base/i40e_nvm.c index 3e16a0d997..56dc4d9279 100644 --- a/drivers/net/intel/i40e/base/i40e_nvm.c +++ b/drivers/net/intel/i40e/base/i40e_nvm.c @@ -1743,7 +1743,7 @@ STATIC enum i40e_status_code i40e_nvmupd_get_aq_result(struct i40e_hw *hw, **/ STATIC enum i40e_status_code i40e_nvmupd_get_aq_event(struct i40e_hw *hw, struct i40e_nvm_access *cmd, - u8 *bytes, int *perrno) + u8 *bytes, __rte_unused int *perrno) { u32 aq_total_len; u32 aq_desc_len; diff --git a/drivers/net/intel/i40e/base/i40e_osdep.h b/drivers/net/intel/i40e/base/i40e_osdep.h index c04f94732a..197f4678bf 100644 --- a/drivers/net/intel/i40e/base/i40e_osdep.h +++ b/drivers/net/intel/i40e/base/i40e_osdep.h @@ -184,8 +184,8 @@ struct __rte_packed_begin i40e_dma_mem { const void *zone; } __rte_packed_end; -#define i40e_allocate_dma_mem(h, m, unused, s, a) \ - i40e_allocate_dma_mem_d(h, m, s, a) +#define i40e_allocate_dma_mem(h, m, mt, s, a) \ + i40e_allocate_dma_mem_d(h, m, mt, s, a) #define i40e_free_dma_mem(h, m) i40e_free_dma_mem_d(h, m) struct __rte_packed_begin i40e_virt_mem { diff --git a/drivers/net/intel/i40e/base/i40e_type.h b/drivers/net/intel/i40e/base/i40e_type.h index 7cc746f82f..968e1982a6 100644 --- a/drivers/net/intel/i40e/base/i40e_type.h +++ b/drivers/net/intel/i40e/base/i40e_type.h @@ -14,11 +14,15 @@ #include "i40e_devids.h" #define UNREFERENCED_XPARAMETER -#define UNREFERENCED_1PARAMETER(_p) (_p); -#define UNREFERENCED_2PARAMETER(_p, _q) (_p); (_q); -#define UNREFERENCED_3PARAMETER(_p, _q, _r) (_p); (_q); (_r); -#define UNREFERENCED_4PARAMETER(_p, _q, _r, _s) (_p); (_q); (_r); (_s); -#define UNREFERENCED_5PARAMETER(_p, _q, _r, _s, _t) (_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) #define BIT(a) (1UL << (a)) #define BIT_ULL(a) (1ULL << (a)) diff --git a/drivers/net/intel/i40e/base/meson.build b/drivers/net/intel/i40e/base/meson.build index a0912b1788..2648e5d0c4 100644 --- a/drivers/net/intel/i40e/base/meson.build +++ b/drivers/net/intel/i40e/base/meson.build @@ -13,10 +13,7 @@ sources = [ error_cflags = [ '-Wno-sign-compare', - '-Wno-unused-value', '-Wno-strict-aliasing', - '-Wno-unused-but-set-variable', - '-Wno-unused-parameter', ] c_args = cflags foreach flag: error_cflags diff --git a/drivers/net/intel/i40e/i40e_ethdev.c b/drivers/net/intel/i40e/i40e_ethdev.c index 1c5ab35a8b..90eba3419f 100644 --- a/drivers/net/intel/i40e/i40e_ethdev.c +++ b/drivers/net/intel/i40e/i40e_ethdev.c @@ -4694,6 +4694,7 @@ i40e_dev_rss_reta_query(struct rte_eth_dev *dev, enum i40e_status_code i40e_allocate_dma_mem_d(__rte_unused struct i40e_hw *hw, struct i40e_dma_mem *mem, + __rte_unused enum i40e_memory_type mtype, u64 size, u32 alignment) { -- 2.45.2