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 04/11] net: ip6_multipath_l3_keys() - use new style struct initializer instead of memset
Date: Thu, 27 Sep 2018 16:00:10 -0700 [thread overview]
Message-ID: <20180927230017.15398-4-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/ipv6/route.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index d28f83e01593..9cb024451fc5 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -1981,12 +1981,11 @@ static void ip6_multipath_l3_keys(const struct sk_buff *skb,
u32 rt6_multipath_hash(const struct net *net, const struct flowi6 *fl6,
const struct sk_buff *skb, struct flow_keys *flkeys)
{
- struct flow_keys hash_keys;
+ struct flow_keys hash_keys = {};
u32 mhash;
switch (ip6_multipath_hash_policy(net)) {
case 0:
- memset(&hash_keys, 0, sizeof(hash_keys));
hash_keys.control.addr_type = FLOW_DISSECTOR_KEY_IPV6_ADDRS;
if (skb) {
ip6_multipath_l3_keys(skb, &hash_keys, flkeys);
@@ -2006,8 +2005,6 @@ u32 rt6_multipath_hash(const struct net *net, const struct flowi6 *fl6,
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;
@@ -2019,7 +2016,6 @@ u32 rt6_multipath_hash(const struct net *net, const struct flowi6 *fl6,
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_IPV6_ADDRS;
hash_keys.addrs.v6addrs.src = fl6->saddr;
hash_keys.addrs.v6addrs.dst = fl6->daddr;
--
2.19.0.605.g01d371f741-goog
next prev 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 ` [PATCH 03/11] net: fib_multipath_hash() " Maciej Żenczykowski
2018-09-28 17:47 ` David Ahern
2018-09-27 23:00 ` Maciej Żenczykowski [this message]
2018-09-28 17:48 ` [PATCH 04/11] net: ip6_multipath_l3_keys() " 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-4-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).