[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <feded298-5b8e-c1f2-adf3-17916efc6790@gmail.com>
Date: Fri, 28 Sep 2018 11:48:09 -0600
From: David Ahern <dsahern@...il.com>
To: Maciej Żenczykowski <zenczykowski@...il.com>,
Maciej Żenczykowski <maze@...gle.com>,
"David S . Miller" <davem@...emloft.net>
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH 04/11] net: ip6_multipath_l3_keys() - use new style struct
initializer instead of memset
On 9/27/18 5:00 PM, Maciej Żenczykowski wrote:
> From: Maciej Żenczykowski <maze@...gle.com>
>
> Signed-off-by: Maciej Żenczykowski <maze@...gle.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;
>
ditto for this one.
Powered by blists - more mailing lists