Thread (40 messages) 40 messages, 8 authors, 2024-02-14
STALE893d
Revisions (2)
  1. v1 current
  2. v2 [diff vs current]

[PATCH 9/9] security: use C11 alignof

From: Tyler Retzlaff <hidden>
Date: 2024-01-24 23:18:53
Subsystem: library code, the rest · Maintainers: Andrew Morton, Linus Torvalds

Replace use of __alignof__(T) with C11 alignof(T) to improve portability
between toolchains.

Signed-off-by: Tyler Retzlaff <redacted>
---
 lib/security/rte_security.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/lib/security/rte_security.c b/lib/security/rte_security.c
index b082a29..e5c862f 100644
--- a/lib/security/rte_security.c
+++ b/lib/security/rte_security.c
@@ -4,6 +4,7 @@
  * Copyright (c) 2020 Samsung Electronics Co., Ltd All Rights Reserved
  */
 
+#include <stdalign.h>
 #include <ctype.h>
 #include <stdlib.h>
 
@@ -38,7 +39,7 @@
 	static const struct rte_mbuf_dynfield dynfield_desc = {
 		.name = RTE_SECURITY_DYNFIELD_NAME,
 		.size = sizeof(rte_security_dynfield_t),
-		.align = __alignof__(rte_security_dynfield_t),
+		.align = alignof(rte_security_dynfield_t),
 	};
 	rte_security_dynfield_offset =
 		rte_mbuf_dynfield_register(&dynfield_desc);
@@ -51,7 +52,7 @@
 	static const struct rte_mbuf_dynfield dynfield_desc = {
 		.name = RTE_SECURITY_OOP_DYNFIELD_NAME,
 		.size = sizeof(rte_security_oop_dynfield_t),
-		.align = __alignof__(rte_security_oop_dynfield_t),
+		.align = alignof(rte_security_oop_dynfield_t),
 	};
 
 	rte_security_oop_dynfield_offset =
-- 
1.8.3.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help