From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C461D46488; Wed, 26 Mar 2025 16:52:51 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0A6494065E; Wed, 26 Mar 2025 16:52:43 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) by mails.dpdk.org (Postfix) with ESMTP id BEB1040649; Wed, 26 Mar 2025 16:52:40 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1743004361; x=1774540361; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=0tFhfciWvwoyFiDHFtOyKO0CNmgPvuFXoXtuBgq9nVI=; b=Zy20flwduoBFitGwDTEvAV56BHOuRNBrkYS0m82AavvswmrBmVefDfpj IenA7FeHu6LxVvOU8KL4OaovtOHbT8Ye1TX5aA0OEoYTS3vSwvzOYqo5L DjDr2YjkGMyxDsx1gNYPVRWUPA8tVQRl/HL2kG58N6+FzJ1vljZ+Zz+J5 4tgtIaKx8TUi0k+ZYzqt2epRtdc9GApxffLnsKzJJVtrBQzlJNPYwQXV2 b2zh8B7mBiTAOkgP3d7OVoOQFq8pKiefIp91fPNf6Q/l0nQNSPHDvq5fu I2CzcDsR4W8oWwTT3Kz3efa7jXjGVk18xoYoraoxIJDqtX72iFMJamX95 g==; X-CSE-ConnectionGUID: 02VqqSzIQiaWgJQingYJ3g== X-CSE-MsgGUID: QhidtZIDQgqD1xd66WPBaQ== X-IronPort-AV: E=McAfee;i="6700,10204,11385"; a="44188320" X-IronPort-AV: E=Sophos;i="6.14,278,1736841600"; d="scan'208";a="44188320" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Mar 2025 08:52:40 -0700 X-CSE-ConnectionGUID: WK70z88CTDOVKQAT+g0S8Q== X-CSE-MsgGUID: cpFjy3NgQbebMMXYhqkZxw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.14,278,1736841600"; d="scan'208";a="124550893" Received: from unknown (HELO silpixa00401385.ir.intel.com) ([10.237.214.31]) by orviesa009.jf.intel.com with ESMTP; 26 Mar 2025 08:52:38 -0700 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson , stable@dpdk.org, Anatoly Burakov , Vladimir Medvedkin Subject: [PATCH 2/7] net/ixgbe/base: correct definition of macro Date: Wed, 26 Mar 2025 15:52:24 +0000 Message-ID: <20250326155230.1315056-3-bruce.richardson@intel.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20250326155230.1315056-1-bruce.richardson@intel.com> References: <20250326155230.1315056-1-bruce.richardson@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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: stable@dpdk.org Signed-off-by: Bruce Richardson --- 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