[v2,09/21] security: use C11 alignof

Message ID 1707849292-19519-10-git-send-email-roretzla@linux.microsoft.com (mailing list archive)
State Accepted, archived
Delegated to: David Marchand
Headers
Series use C11 alignof |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Tyler Retzlaff Feb. 13, 2024, 6:34 p.m. UTC
  Replace use of __alignof__(T) with C11 alignof(T) to improve portability
between toolchains.

Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
---
 lib/security/rte_security.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
  

Patch

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 =