From 67afaab411001d777c4af6b016c7c045ef4d8ed5 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Fri, 6 Jan 2023 11:43:13 +1100 Subject: tcp, udp: Use named field initializers in iov_init functions Both the TCP and UDP iov_init functions have some large structure literals defined in "field order" style. These are pretty hard to read since it's not obvious what value corresponds to what field. Use named field style initializers instead to make this clearer. Signed-off-by: David Gibson Signed-off-by: Stefano Brivio --- udp.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'udp.c') diff --git a/udp.c b/udp.c index dbfdb61..fb3f790 100644 --- a/udp.c +++ b/udp.c @@ -329,9 +329,8 @@ static void udp_sock4_iov_init(const struct ctx *c) for (i = 0; i < ARRAY_SIZE(udp4_l2_buf); i++) { udp4_l2_buf[i] = (struct udp4_l2_buf_t) { - { 0 }, 0, 0, - L2_BUF_ETH_IP4_INIT, L2_BUF_IP4_INIT(IPPROTO_UDP), - {{{ 0 }}}, { 0 }, + .eh = L2_BUF_ETH_IP4_INIT, + .iph = L2_BUF_IP4_INIT(IPPROTO_UDP) }; } @@ -371,12 +370,8 @@ static void udp_sock6_iov_init(const struct ctx *c) for (i = 0; i < ARRAY_SIZE(udp6_l2_buf); i++) { udp6_l2_buf[i] = (struct udp6_l2_buf_t) { - { 0 }, -#ifdef __AVX2__ - { 0 }, -#endif - 0, L2_BUF_ETH_IP6_INIT, L2_BUF_IP6_INIT(IPPROTO_UDP), - {{{ 0 }}}, { 0 }, + .eh = L2_BUF_ETH_IP6_INIT, + .ip6h = L2_BUF_IP6_INIT(IPPROTO_UDP) }; } -- cgit v1.2.3