From: Stephen Hemminger <stephen@networkplumber.org>
To: David Miller <davem@davemloft.net>
Cc: zwu.kernel@gmail.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, wuzhy@linux.vnet.ibm.com
Subject: Re: [PATCH 1/3] vxlan: silence one build warning
Date: Mon, 28 Oct 2013 08:25:11 -0700 [thread overview]
Message-ID: <20131028082511.2433d645@nehalam.linuxnetplumber.net> (raw)
In-Reply-To: <20131028.003807.1591686723281776238.davem@davemloft.net>
On Mon, 28 Oct 2013 00:38:07 -0400 (EDT)
David Miller <davem@davemloft.net> wrote:
> From: Stephen Hemminger <stephen@networkplumber.org>
> Date: Fri, 25 Oct 2013 08:41:34 -0700
>
> > I would rather not fix the warning this way since it risks masking
> > later bugs if this code ever changes.
>
> But this is suboptimally coded, and is asking for the warning.
>
> Anything returning a pointer by reference is asking for trouble
> in my opinion.
>
> The correct thing to do is to make create_v{4,6}_sock() return
> the "struct socket *" as an error pointer.
>
> No more ambiguous initializations, no more warnings.
Agreed, original code used ERR_PTR (see vxlan_socket_create),
the side effect stuff only came with the addition of IPv6.
prev parent reply other threads:[~2013-10-28 15:25 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-25 7:49 [PATCH 1/3] vxlan: silence one build warning Zhi Yong Wu
2013-10-25 7:49 ` [PATCH 2/3] net, datagram: fix the uncorrect comment in zerocopy_sg_from_iovec() Zhi Yong Wu
2013-10-28 4:39 ` David Miller
2013-10-25 7:49 ` [PATCH 3/3] net, iovec: fix the uncorrect comment in memcpy_fromiovecend() Zhi Yong Wu
2013-10-25 15:41 ` [PATCH 1/3] vxlan: silence one build warning Stephen Hemminger
2013-10-26 7:06 ` Zhi Yong Wu
2013-10-26 14:48 ` Stephen Hemminger
2013-10-27 2:30 ` Zhi Yong Wu
2013-10-27 19:33 ` Stephen Hemminger
2013-10-28 4:38 ` David Miller
2013-10-28 15:25 ` Stephen Hemminger [this message]
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=20131028082511.2433d645@nehalam.linuxnetplumber.net \
--to=stephen@networkplumber.org \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=wuzhy@linux.vnet.ibm.com \
--cc=zwu.kernel@gmail.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).