[v2,18/21] net/sfc: use C11 alignof

Message ID 1707849292-19519-19-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/sfc/sfc_dp.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
  

Patch

diff --git a/drivers/net/sfc/sfc_dp.c b/drivers/net/sfc/sfc_dp.c
index 2b0a1d7..7e2a20e 100644
--- a/drivers/net/sfc/sfc_dp.c
+++ b/drivers/net/sfc/sfc_dp.c
@@ -8,6 +8,7 @@ 
  */
 
 #include <sys/queue.h>
+#include <stdalign.h>
 #include <string.h>
 #include <errno.h>
 
@@ -91,7 +92,7 @@  struct sfc_dp *
 	static const struct rte_mbuf_dynfield mport = {
 		.name = "rte_net_sfc_dynfield_mport",
 		.size = sizeof(efx_mport_id_t),
-		.align = __alignof__(efx_mport_id_t),
+		.align = alignof(efx_mport_id_t),
 	};
 	static const struct rte_mbuf_dynflag mport_override = {
 		.name = "rte_net_sfc_dynflag_mport_override",
@@ -134,7 +135,7 @@  struct sfc_dp *
 	static const struct rte_mbuf_dynfield ft_ctx_id = {
 		.name = "rte_net_sfc_dynfield_ft_ctx_id",
 		.size = sizeof(uint8_t),
-		.align = __alignof__(uint8_t),
+		.align = alignof(uint8_t),
 	};
 
 	int field_offset;