DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH v1] net/zxdh: fix using static assert in macro definition
@ 2025-04-09  1:39 Junlong Wang
  0 siblings, 0 replies; only message in thread
From: Junlong Wang @ 2025-04-09  1:39 UTC (permalink / raw)
  To: stephen; +Cc: dev, Junlong Wang


[-- 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 --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-04-09  1:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-09  1:39 [PATCH v1] net/zxdh: fix using static assert in macro definition Junlong Wang

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