[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20160725.173701.1282720667210726281.davem@davemloft.net>
Date: Mon, 25 Jul 2016 17:37:01 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: decui@...rosoft.com
Cc: gregkh@...uxfoundation.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, devel@...uxdriverproject.org,
olaf@...fle.de, apw@...onical.com, jasowang@...hat.com,
vkuznets@...hat.com, cavery@...hat.com, kys@...rosoft.com,
joe@...ches.com, rolf.neugebauer@...ker.com, mkubecek@...e.cz,
haiyangz@...rosoft.com, dave.scott@...ker.com
Subject: Re: [PATCH v18 net-next 1/1] hv_sock: introduce Hyper-V Sockets
From: Dexuan Cui <decui@...rosoft.com>
Date: Sat, 23 Jul 2016 01:35:51 +0000
> +static struct sock *hvsock_create(struct net *net, struct socket *sock,
> + gfp_t priority, unsigned short type)
> +{
> + struct hvsock_sock *hvsk;
> + struct sock *sk;
> +
> + sk = sk_alloc(net, AF_HYPERV, priority, &hvsock_proto, 0);
> + if (!sk)
> + return NULL;
...
> + /* Looks stream-based socket doesn't need this. */
> + sk->sk_backlog_rcv = NULL;
> +
> + sk->sk_state = 0;
> + sock_reset_flag(sk, SOCK_DONE);
All of these are unnecessary initializations, since sk_alloc() zeroes
out the 'sk' object for you.
Powered by blists - more mailing lists