From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (xvm-189-124.dc0.ghst.net [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6E97AA0524; Thu, 7 Jan 2021 12:46:26 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 074B8140F49; Thu, 7 Jan 2021 12:46:26 +0100 (CET) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by mails.dpdk.org (Postfix) with ESMTP id 5B23E140F44 for ; Thu, 7 Jan 2021 12:46:24 +0100 (CET) Received: from Internal Mail-Server by MTLPINE1 (envelope-from talshn@nvidia.com) with SMTP; 7 Jan 2021 13:46:23 +0200 Received: from nvidia.com (l-wincomp04-vm.mtl.labs.mlnx [10.237.1.5]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 107BkNxv003360; Thu, 7 Jan 2021 13:46:23 +0200 From: Tal Shnaiderman To: dev@dpdk.org Cc: thomas@monjalon.net, matan@nvidia.com, rasland@nvidia.com, ophirmu@nvidia.com, stable@dpdk.org Date: Thu, 7 Jan 2021 13:45:45 +0200 Message-Id: <20210107114545.12124-1-talshn@nvidia.com> X-Mailer: git-send-email 2.16.1.windows.4 In-Reply-To: <20210106134221.12896-1-talshn@nvidia.com> References: <20210106134221.12896-1-talshn@nvidia.com> Subject: [dpdk-dev] [PATCH v2] mlx5: fix __mlx5_bit_off macro warning for Windows 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 Sender: "dev" While compiling with clang 11 the callers of the __mlx5_bit_off macro warns on the cast of pointers to unsigned long which is a smaller int type in Windows. warning: cast to smaller integer type 'unsigned long' from 'u8 (*)[16]' [-Wpointer-to-int-cast] To resolve it the type is changed to uintptr_t to be compatible for both Linux and Windows. Fixes: 865a0c15672c ("net/mlx5: add Direct Verbs prepare function") Cc: stable@dpdk.org Signed-off-by: Tal Shnaiderman --- v2: change type to uintptr_t [DmitryK] --- drivers/common/mlx5/mlx5_prm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/common/mlx5/mlx5_prm.h b/drivers/common/mlx5/mlx5_prm.h index 8c9b53ce10..b6a3a3cfcb 100644 --- a/drivers/common/mlx5/mlx5_prm.h +++ b/drivers/common/mlx5/mlx5_prm.h @@ -601,7 +601,7 @@ typedef uint8_t u8; #define __mlx5_nullp(typ) ((struct mlx5_ifc_##typ##_bits *)0) #define __mlx5_bit_sz(typ, fld) sizeof(__mlx5_nullp(typ)->fld) -#define __mlx5_bit_off(typ, fld) ((unsigned int)(unsigned long) \ +#define __mlx5_bit_off(typ, fld) ((unsigned int)(uintptr_t) \ (&(__mlx5_nullp(typ)->fld))) #define __mlx5_dw_bit_off(typ, fld) (32 - __mlx5_bit_sz(typ, fld) - \ (__mlx5_bit_off(typ, fld) & 0x1f)) -- 2.16.1.windows.4