[v2,19/21] net/virtio: use C11 alignof
Checks
Commit Message
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/virtio/virtio_rxtx.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
@@ -2,6 +2,7 @@
* Copyright(c) 2010-2014 Intel Corporation
*/
+#include <stdalign.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
@@ -1797,7 +1798,7 @@
txm->nb_segs == 1 &&
rte_pktmbuf_headroom(txm) >= hdr_size &&
rte_is_aligned(rte_pktmbuf_mtod(txm, char *),
- __alignof__(struct virtio_net_hdr_mrg_rxbuf)))
+ alignof(struct virtio_net_hdr_mrg_rxbuf)))
can_push = 1;
else if (virtio_with_feature(hw, VIRTIO_RING_F_INDIRECT_DESC) &&
txm->nb_segs < VIRTIO_MAX_TX_INDIRECT)
@@ -1878,7 +1879,7 @@
txm->nb_segs == 1 &&
rte_pktmbuf_headroom(txm) >= hdr_size &&
rte_is_aligned(rte_pktmbuf_mtod(txm, char *),
- __alignof__(struct virtio_net_hdr_mrg_rxbuf)))
+ alignof(struct virtio_net_hdr_mrg_rxbuf)))
can_push = 1;
else if (virtio_with_feature(hw, VIRTIO_RING_F_INDIRECT_DESC) &&
txm->nb_segs < VIRTIO_MAX_TX_INDIRECT)
@@ -1980,7 +1981,7 @@
txm->nb_segs == 1 &&
rte_pktmbuf_headroom(txm) >= hdr_size &&
rte_is_aligned(rte_pktmbuf_mtod(txm, char *),
- __alignof__(struct virtio_net_hdr_mrg_rxbuf))) {
+ alignof(struct virtio_net_hdr_mrg_rxbuf))) {
inorder_pkts[nb_inorder_pkts] = txm;
nb_inorder_pkts++;