From: David Miller <davem@davemloft.net>
To: decui@microsoft.com
Cc: mkubecek@suse.cz, olaf@aepfle.de, gregkh@linuxfoundation.org,
jasowang@redhat.com, dave.scott@docker.com,
linux-kernel@vger.kernel.org, joe@perches.com,
rolf.neugebauer@docker.com, netdev@vger.kernel.org,
apw@canonical.com, devel@linuxdriverproject.org,
haiyangz@microsoft.com
Subject: Re: [PATCH v18 net-next 1/1] hv_sock: introduce Hyper-V Sockets
Date: Mon, 25 Jul 2016 17:37:01 -0700 (PDT) [thread overview]
Message-ID: <20160725.173701.1282720667210726281.davem@davemloft.net> (raw)
In-Reply-To: <CO2PR03MB2182FD2D8AED7FFC7608510FBF0B0@CO2PR03MB2182.namprd03.prod.outlook.com>
From: Dexuan Cui <decui@microsoft.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.
next prev parent reply other threads:[~2016-07-26 0:37 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-23 1:35 [PATCH v18 net-next 1/1] hv_sock: introduce Hyper-V Sockets Dexuan Cui
2016-07-26 0:37 ` David Miller [this message]
2016-07-26 3:09 ` Dexuan Cui
2016-07-26 4:38 ` David Miller
2016-07-26 5:10 ` Dexuan Cui
2016-07-26 7:09 ` Dexuan Cui
2016-07-26 9:56 ` Michal Kubecek
2016-07-26 13:22 ` Dexuan Cui
2016-07-27 9:20 ` Dexuan Cui
2016-07-26 17:44 ` David Miller
2016-07-27 9:20 ` Dexuan Cui
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=20160725.173701.1282720667210726281.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=apw@canonical.com \
--cc=dave.scott@docker.com \
--cc=decui@microsoft.com \
--cc=devel@linuxdriverproject.org \
--cc=gregkh@linuxfoundation.org \
--cc=haiyangz@microsoft.com \
--cc=jasowang@redhat.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mkubecek@suse.cz \
--cc=netdev@vger.kernel.org \
--cc=olaf@aepfle.de \
--cc=rolf.neugebauer@docker.com \
/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).