DPDK patches and discussions
 help / color / mirror / Atom feed
From: Junlong Wang <wang.junlong1@zte.com.cn>
To: stephen@networkplumber.org
Cc: dev@dpdk.org, Junlong Wang <wang.junlong1@zte.com.cn>
Subject: [PATCH v1] net/zxdh: fix using static assert in macro definition
Date: Wed,  9 Apr 2025 09:39:55 +0800	[thread overview]
Message-ID: <20250409013955.133122-1-wang.junlong1@zte.com.cn> (raw)


[-- Attachment #1.1.1: Type: text/plain, Size: 1424 bytes --]

using static_assert(RTE_BUILD_BUG_ON) replaced BUILD_BUG_ON.

Fixes: 9c3a123f9e08 ("net/zxdh: optimize msg processing ops and modify some issues")

Signed-off-by: Junlong Wang <wang.junlong1@zte.com.cn>
---
 drivers/net/zxdh/zxdh_common.h | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/net/zxdh/zxdh_common.h b/drivers/net/zxdh/zxdh_common.h
index aaf4e0bedb..c151101bbc 100644
--- a/drivers/net/zxdh/zxdh_common.h
+++ b/drivers/net/zxdh/zxdh_common.h
@@ -87,20 +87,15 @@ zxdh_set_value(uint32_t fld_sz, uint8_t *addr, size_t value) {
 #define ZXDH_BYTE_OFF(typ, fld) (__zxdh_bit_off(typ, fld) / 8)
 #define ZXDH_ADDR_OF(typ, p, fld) ((uint8_t *)(p) + ZXDH_BYTE_OFF(typ, fld))
 
-#define BUILD_BUG_ON(condition) do { \
-	if (condition) \
-		__builtin_unreachable(); \
-	} while (0)
-
 #define ZXDH_SET(typ, p, fld, v) do { \
-	BUILD_BUG_ON(__zxdh_bit_sz(typ, fld) % 8); \
+	RTE_BUILD_BUG_ON(__zxdh_bit_sz(typ, fld) % 8); \
 	uint32_t fld_sz = __zxdh_bit_sz(typ, fld) / 8; \
 	uint8_t *addr = ZXDH_ADDR_OF(typ, p, fld); \
 	zxdh_set_value(fld_sz, addr, v); \
 } while (0)
 
 #define ZXDH_GET(typ, p, fld) ({ \
-	BUILD_BUG_ON(__zxdh_bit_sz(typ, fld) % 8); \
+	RTE_BUILD_BUG_ON(__zxdh_bit_sz(typ, fld) % 8); \
 	uint32_t fld_sz = __zxdh_bit_sz(typ, fld) / 8; \
 	uint8_t *addr = ZXDH_ADDR_OF(typ, p, fld); \
 	zxdh_get_value(fld_sz, addr); \
-- 
2.27.0

[-- Attachment #1.1.2: Type: text/html , Size: 2633 bytes --]

                 reply	other threads:[~2025-04-09  1:40 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=20250409013955.133122-1-wang.junlong1@zte.com.cn \
    --to=wang.junlong1@zte.com.cn \
    --cc=dev@dpdk.org \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).