netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Maciej Żenczykowski" <zenczykowski@gmail.com>
To: "Maciej Żenczykowski" <maze@google.com>,
	"David S . Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: [PATCH 03/11] net: fib_multipath_hash() - use new style struct initializer instead of memset
Date: Thu, 27 Sep 2018 16:00:09 -0700	[thread overview]
Message-ID: <20180927230017.15398-3-zenczykowski@gmail.com> (raw)
In-Reply-To: <20180927230017.15398-1-zenczykowski@gmail.com>

From: Maciej Żenczykowski <maze@google.com>

Signed-off-by: Maciej Żenczykowski <maze@google.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

  parent reply	other threads:[~2018-09-28  5:21 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-27 23:00 [PATCH 01/11] net: ip_rt_get_source() - use new style struct initializer instead of memset Maciej Żenczykowski
2018-09-27 23:00 ` [PATCH 02/11] net: inet_rtm_getroute() " Maciej Żenczykowski
2018-09-27 23:00 ` Maciej Żenczykowski [this message]
2018-09-28 17:47   ` [PATCH 03/11] net: fib_multipath_hash() " David Ahern
2018-09-27 23:00 ` [PATCH 04/11] net: ip6_multipath_l3_keys() " Maciej Żenczykowski
2018-09-28 17:48   ` David Ahern
2018-09-27 23:00 ` [PATCH 05/11] net: ip6_redirect() " Maciej Żenczykowski
2018-09-27 23:00 ` [PATCH 06/11] net: ip6_redirect_no_header() " Maciej Żenczykowski
2018-09-27 23:00 ` [PATCH 07/11] net: remove 1 always zero parameter from ip6_redirect_no_header() Maciej Żenczykowski
2018-09-27 23:00 ` [PATCH 08/11] net: ip6_update_pmtu() - use new style struct initializer instead of memset Maciej Żenczykowski
2018-09-27 23:00 ` [PATCH 09/11] net: rtmsg_to_fib6_config() " Maciej Żenczykowski
2018-09-27 23:00 ` [PATCH 10/11] net: rtm_to_fib6_config() " Maciej Żenczykowski
2018-09-27 23:00 ` [PATCH 11/11] net: inet6_rtm_getroute() " Maciej Żenczykowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180927230017.15398-3-zenczykowski@gmail.com \
    --to=zenczykowski@gmail.com \
    --cc=davem@davemloft.net \
    --cc=maze@google.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).