Netdev Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] af_unix: __unix_find_socket_byname() cleanup
@ 2019-10-10  3:43 Vito Caputo
  2019-10-12  3:40 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Vito Caputo @ 2019-10-10  3:43 UTC (permalink / raw)
  To: davem; +Cc: netdev, linux-kernel

Remove pointless return variable dance.

Appears vestigial from when the function did locking as seen in
unix_find_socket_byinode(), but locking is handled in
unix_find_socket_byname() for __unix_find_socket_byname().

Signed-off-by: Vito Caputo <vcaputo@pengaru.com>
---
 net/unix/af_unix.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 67e87db5877f..c853ad0875f4 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -284,11 +284,9 @@ static struct sock *__unix_find_socket_byname(struct net *net,
 
 		if (u->addr->len == len &&
 		    !memcmp(u->addr->name, sunname, len))
-			goto found;
+			return s;
 	}
-	s = NULL;
-found:
-	return s;
+	return NULL;
 }
 
 static inline struct sock *unix_find_socket_byname(struct net *net,
-- 
2.11.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] af_unix: __unix_find_socket_byname() cleanup
  2019-10-10  3:43 [PATCH] af_unix: __unix_find_socket_byname() cleanup Vito Caputo
@ 2019-10-12  3:40 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2019-10-12  3:40 UTC (permalink / raw)
  To: vcaputo; +Cc: netdev, linux-kernel

From: Vito Caputo <vcaputo@pengaru.com>
Date: Wed, 9 Oct 2019 20:43:47 -0700

> Remove pointless return variable dance.
> 
> Appears vestigial from when the function did locking as seen in
> unix_find_socket_byinode(), but locking is handled in
> unix_find_socket_byname() for __unix_find_socket_byname().
> 
> Signed-off-by: Vito Caputo <vcaputo@pengaru.com>

I agree with your analysis. :-)

Applied to net-next.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-10  3:43 [PATCH] af_unix: __unix_find_socket_byname() cleanup Vito Caputo
2019-10-12  3:40 ` David Miller

Netdev Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/netdev/0 netdev/git/0.git
	git clone --mirror https://lore.kernel.org/netdev/1 netdev/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 netdev netdev/ https://lore.kernel.org/netdev \
		netdev@vger.kernel.org netdev@archiver.kernel.org
	public-inbox-index netdev

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.netdev


AGPL code for this site: git clone https://public-inbox.org/ public-inbox