[v2,20/21] net/vmxnet3: use C11 alignof

Message ID 1707849292-19519-21-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>
---
 drivers/net/vmxnet3/vmxnet3_ethdev.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Patch

diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index 4fd7040..b239ea3 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -3,6 +3,7 @@ 
  */
 
 #include <sys/queue.h>
+#include <stdalign.h>
 #include <stdio.h>
 #include <errno.h>
 #include <stdint.h>
@@ -367,7 +368,7 @@  struct vmxnet3_xstats_name_off {
 	static const struct rte_mbuf_dynfield vmxnet3_segs_dynfield_desc = {
 		.name = VMXNET3_SEGS_DYNFIELD_NAME,
 		.size = sizeof(vmxnet3_segs_dynfield_t),
-		.align = __alignof__(vmxnet3_segs_dynfield_t),
+		.align = alignof(vmxnet3_segs_dynfield_t),
 	};
 
 	PMD_INIT_FUNC_TRACE();