[7/9] pdcp: use C11 alignof

Message ID 1706138276-28224-8-git-send-email-roretzla@linux.microsoft.com (mailing list archive)
State Superseded, archived
Delegated to: David Marchand
Headers
Series use C11 alignof |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Tyler Retzlaff Jan. 24, 2024, 11:17 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>
---
 lib/pdcp/rte_pdcp.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
  

Comments

Anoob Joseph Jan. 25, 2024, 4:36 a.m. UTC | #1
> 
> External Email
> 
> ----------------------------------------------------------------------
> 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: Anoob Joseph <anoobj@marvell.com>
  

Patch

diff --git a/lib/pdcp/rte_pdcp.c b/lib/pdcp/rte_pdcp.c
index 1c6d246..1c076fb 100644
--- a/lib/pdcp/rte_pdcp.c
+++ b/lib/pdcp/rte_pdcp.c
@@ -2,6 +2,8 @@ 
  * Copyright(C) 2023 Marvell.
  */
 
+#include <stdalign.h>
+
 #include <rte_errno.h>
 #include <rte_pdcp.h>
 #include <rte_malloc.h>
@@ -32,7 +34,7 @@  struct entity_layout {
 	const struct rte_mbuf_dynfield dynfield_desc = {
 		.name = RTE_PDCP_DYNFIELD_NAME,
 		.size = sizeof(rte_pdcp_dynfield_t),
-		.align = __alignof__(rte_pdcp_dynfield_t),
+		.align = alignof(rte_pdcp_dynfield_t),
 	};
 
 	if (rte_pdcp_dynfield_offset != -1)