diff mbox series

[08/11] net: ip6_update_pmtu() - use new style struct initializer instead of memset

Message ID 20180927230017.15398-8-zenczykowski@gmail.com
State Changes Requested, archived
Delegated to: David Miller
Headers show
Series [01/11] net: ip_rt_get_source() - use new style struct initializer instead of memset | expand

Commit Message

Maciej Żenczykowski Sept. 27, 2018, 11 p.m. UTC
From: Maciej Żenczykowski <maze@google.com>

(allows for better compiler optimization)

Signed-off-by: Maciej Żenczykowski <maze@google.com>
---
 net/ipv6/route.c | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)
diff mbox series

Patch

diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 27f1260e053a..a87b79574a91 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -2345,15 +2345,14 @@  void ip6_update_pmtu(struct sk_buff *skb, struct net *net, __be32 mtu,
 {
 	const struct ipv6hdr *iph = (struct ipv6hdr *) skb->data;
 	struct dst_entry *dst;
-	struct flowi6 fl6;
-
-	memset(&fl6, 0, sizeof(fl6));
-	fl6.flowi6_oif = oif;
-	fl6.flowi6_mark = mark ? mark : IP6_REPLY_MARK(net, skb->mark);
-	fl6.daddr = iph->daddr;
-	fl6.saddr = iph->saddr;
-	fl6.flowlabel = ip6_flowinfo(iph);
-	fl6.flowi6_uid = uid;
+	struct flowi6 fl6 = {
+		.flowi6_oif = oif,
+		.flowi6_mark = mark ? mark : IP6_REPLY_MARK(net, skb->mark),
+		.daddr = iph->daddr,
+		.saddr = iph->saddr,
+		.flowlabel = ip6_flowinfo(iph),
+		.flowi6_uid = uid,
+	};
 
 	dst = ip6_route_output(net, NULL, &fl6);
 	if (!dst->error)