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 B830CA0A01 for ; Wed, 6 Jan 2021 14:42:49 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AF486160983; Wed, 6 Jan 2021 14:42:49 +0100 (CET) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by mails.dpdk.org (Postfix) with ESMTP id EE21F160976 for ; Wed, 6 Jan 2021 14:42:46 +0100 (CET) Received: from Internal Mail-Server by MTLPINE1 (envelope-from talshn@nvidia.com) with SMTP; 6 Jan 2021 15:42:45 +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 106DgjUS017976; Wed, 6 Jan 2021 15:42:45 +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: Wed, 6 Jan 2021 15:42:21 +0200 Message-Id: <20210106134221.12896-1-talshn@nvidia.com> X-Mailer: git-send-email 2.16.1.windows.4 Subject: [dpdk-stable] [PATCH] mlx5: fix __mlx5_bit_off macro warning for Windows X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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 size_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 Acked-by: Matan Azrad --- 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..2cb3bf6005 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)(size_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