Thread (11 messages) flat view 11 messages, 3 authors, 2013-10-28

Re: [PATCH 1/3] vxlan: silence one build warning

From: Stephen Hemminger <stephen@networkplumber.org>
Date: 2013-10-28 15:25:18
Also in: lkml

On Mon, 28 Oct 2013 00:38:07 -0400 (EDT)
David Miller [off-list ref] wrote:
From: Stephen Hemminger <stephen@networkplumber.org>
Date: Fri, 25 Oct 2013 08:41:34 -0700
quoted
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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help