The definition of IXGBE_LE32_TO_CPUS macro is meant to modify the value in place - similar to the le32_to_cpus() macro in kernel. Fixing the definition allows us to remove some warning flags, and removes the need for the uintptr_t typecasts.
Fixes: aa4fc14d2cee ("ixgbe: update base driver") Cc: sta...@dpdk.org Signed-off-by: Bruce Richardson <bruce.richard...@intel.com> --- drivers/net/intel/ixgbe/base/ixgbe_common.c | 4 ++-- drivers/net/intel/ixgbe/base/ixgbe_osdep.h | 2 +- drivers/net/intel/ixgbe/base/meson.build | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/intel/ixgbe/base/ixgbe_common.c b/drivers/net/intel/ixgbe/base/ixgbe_common.c index d6425c5b78..fbc9605e4d 100644 --- a/drivers/net/intel/ixgbe/base/ixgbe_common.c +++ b/drivers/net/intel/ixgbe/base/ixgbe_common.c @@ -4610,7 +4610,7 @@ s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, u32 *buffer, /* first pull in the header so we know the buffer length */ for (bi = 0; bi < dword_len; bi++) { buffer[bi] = IXGBE_READ_REG_ARRAY(hw, IXGBE_FLEX_MNG, bi); - IXGBE_LE32_TO_CPUS((uintptr_t)&buffer[bi]); + IXGBE_LE32_TO_CPUS(&buffer[bi]); } /* @@ -4646,7 +4646,7 @@ s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, u32 *buffer, /* Pull in the rest of the buffer (bi is where we left off) */ for (; bi <= dword_len; bi++) { buffer[bi] = IXGBE_READ_REG_ARRAY(hw, IXGBE_FLEX_MNG, bi); - IXGBE_LE32_TO_CPUS((uintptr_t)&buffer[bi]); + IXGBE_LE32_TO_CPUS(&buffer[bi]); } rel_out: diff --git a/drivers/net/intel/ixgbe/base/ixgbe_osdep.h b/drivers/net/intel/ixgbe/base/ixgbe_osdep.h index cffc6a4ce8..6e5f7b4ae8 100644 --- a/drivers/net/intel/ixgbe/base/ixgbe_osdep.h +++ b/drivers/net/intel/ixgbe/base/ixgbe_osdep.h @@ -83,7 +83,7 @@ enum { #define IXGBE_LE16_TO_CPU(_i) rte_le_to_cpu_16(_i) #define IXGBE_LE32_TO_CPU(_i) rte_le_to_cpu_32(_i) #define IXGBE_LE64_TO_CPU(_i) rte_le_to_cpu_64(_i) -#define IXGBE_LE32_TO_CPUS(_i) rte_le_to_cpu_32(_i) +#define IXGBE_LE32_TO_CPUS(_i) do { *_i = rte_le_to_cpu_32(*_i); } while(0) #define IXGBE_CPU_TO_BE16(_i) rte_cpu_to_be_16(_i) #define IXGBE_CPU_TO_BE32(_i) rte_cpu_to_be_32(_i) #define IXGBE_BE32_TO_CPU(_i) rte_be_to_cpu_32(_i) diff --git a/drivers/net/intel/ixgbe/base/meson.build b/drivers/net/intel/ixgbe/base/meson.build index 7e4fbdfa0f..f8b2ee6341 100644 --- a/drivers/net/intel/ixgbe/base/meson.build +++ b/drivers/net/intel/ixgbe/base/meson.build @@ -19,7 +19,7 @@ sources = [ 'ixgbe_x550.c', ] -error_cflags = ['-Wno-unused-value', +error_cflags = [ '-Wno-unused-but-set-variable', '-Wno-unused-parameter', ] -- 2.45.2