patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Tal Shnaiderman <>
Subject: [dpdk-stable] [PATCH v2] mlx5: fix __mlx5_bit_off macro warning for Windows
Date: Thu,  7 Jan 2021 13:45:45 +0200
Message-ID: <> (raw)
In-Reply-To: <>

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")

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) \
 #define __mlx5_dw_bit_off(typ, fld) (32 - __mlx5_bit_sz(typ, fld) - \
 				    (__mlx5_bit_off(typ, fld) & 0x1f))

  parent reply	other threads:[~2021-01-07 11:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-06 13:42 [dpdk-stable] [PATCH] " Tal Shnaiderman
2021-01-06 14:22 ` [dpdk-stable] [dpdk-dev] " Dmitry Kozlyuk
2021-01-07 11:40   ` Tal Shnaiderman
2021-01-07 11:45 ` Tal Shnaiderman [this message]
2021-01-07 12:59   ` [dpdk-stable] [PATCH v2] " Matan Azrad
2021-01-12 21:45     ` [dpdk-stable] [dpdk-dev] " Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

patches for DPDK stable branches

This inbox may be cloned and mirrored by anyone:

	git clone --mirror stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ \
	public-inbox-index stable

Example config snippet for mirrors.
Newsgroup available over NNTP:

AGPL code for this site: git clone