[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180927230017.15398-3-zenczykowski@gmail.com>
Date: Thu, 27 Sep 2018 16:00:09 -0700
From: "Maciej Żenczykowski" <zenczykowski@...il.com>
To: "Maciej Żenczykowski" <maze@...gle.com>,
"David S . Miller" <davem@...emloft.net>
Cc: netdev@...r.kernel.org
Subject: [PATCH 03/11] net: fib_multipath_hash() - use new style struct
initializer instead of memset
From: Maciej Żenczykowski <maze@...gle.com>
Signed-off-by: Maciej Żenczykowski <maze@...gle.com>
---
net/ipv4/route.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 048919713f4e..17953a52fbd0 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1821,12 +1821,11 @@ static void ip_multipath_l3_keys(const struct sk_buff *skb,
int fib_multipath_hash(const struct net *net, const struct flowi4 *fl4,
const struct sk_buff *skb, struct flow_keys *flkeys)
{
- struct flow_keys hash_keys;
+ struct flow_keys hash_keys = {};
u32 mhash;
switch (net->ipv4.sysctl_fib_multipath_hash_policy) {
case 0:
- memset(&hash_keys, 0, sizeof(hash_keys));
hash_keys.control.addr_type = FLOW_DISSECTOR_KEY_IPV4_ADDRS;
if (skb) {
ip_multipath_l3_keys(skb, &hash_keys);
@@ -1845,8 +1844,6 @@ int fib_multipath_hash(const struct net *net, const struct flowi4 *fl4,
if (skb->l4_hash)
return skb_get_hash_raw(skb) >> 1;
- memset(&hash_keys, 0, sizeof(hash_keys));
-
if (!flkeys) {
skb_flow_dissect_flow_keys(skb, &keys, flag);
flkeys = &keys;
@@ -1859,7 +1856,6 @@ int fib_multipath_hash(const struct net *net, const struct flowi4 *fl4,
hash_keys.ports.dst = flkeys->ports.dst;
hash_keys.basic.ip_proto = flkeys->basic.ip_proto;
} else {
- memset(&hash_keys, 0, sizeof(hash_keys));
hash_keys.control.addr_type = FLOW_DISSECTOR_KEY_IPV4_ADDRS;
hash_keys.addrs.v4addrs.src = fl4->saddr;
hash_keys.addrs.v4addrs.dst = fl4->daddr;
--
2.19.0.605.g01d371f741-goog
Powered by blists - more mailing lists