linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [net-next PATCH] tcp: md5: hide unused variable
@ 2017-06-20 20:11 Arnd Bergmann
  2017-06-21 15:20 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2017-06-20 20:11 UTC (permalink / raw)
  To: David S. Miller, Alexey Kuznetsov, James Morris,
	Hideaki YOSHIFUJI, Patrick McHardy
  Cc: Arnd Bergmann, Ivan Delalande, netdev, linux-kernel

Changing from a memcpy to per-member comparison left the
size variable unused:

net/ipv4/tcp_ipv4.c: In function 'tcp_md5_do_lookup':
net/ipv4/tcp_ipv4.c:910:15: error: unused variable 'size' [-Werror=unused-variable]

This does not show up when CONFIG_IPV6 is enabled, but the
variable can be removed either way, along with the now unused
assignment.

Fixes: 6797318e623d ("tcp: md5: add an address prefix for key lookup")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 net/ipv4/tcp_ipv4.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index bf407f3e20dd..e20bcf0061af 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -907,7 +907,6 @@ struct tcp_md5sig_key *tcp_md5_do_lookup(const struct sock *sk,
 {
 	const struct tcp_sock *tp = tcp_sk(sk);
 	struct tcp_md5sig_key *key;
-	unsigned int size = sizeof(struct in_addr);
 	const struct tcp_md5sig_info *md5sig;
 	__be32 mask;
 	struct tcp_md5sig_key *best_match = NULL;
@@ -918,10 +917,7 @@ struct tcp_md5sig_key *tcp_md5_do_lookup(const struct sock *sk,
 				       lockdep_sock_is_held(sk));
 	if (!md5sig)
 		return NULL;
-#if IS_ENABLED(CONFIG_IPV6)
-	if (family == AF_INET6)
-		size = sizeof(struct in6_addr);
-#endif
+
 	hlist_for_each_entry_rcu(key, &md5sig->head, node) {
 		if (key->family != family)
 			continue;
-- 
2.9.0

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

* Re: [net-next PATCH] tcp: md5: hide unused variable
  2017-06-20 20:11 [net-next PATCH] tcp: md5: hide unused variable Arnd Bergmann
@ 2017-06-21 15:20 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2017-06-21 15:20 UTC (permalink / raw)
  To: arnd; +Cc: kuznet, jmorris, yoshfuji, kaber, colona, netdev, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>
Date: Tue, 20 Jun 2017 22:11:21 +0200

> Changing from a memcpy to per-member comparison left the
> size variable unused:
> 
> net/ipv4/tcp_ipv4.c: In function 'tcp_md5_do_lookup':
> net/ipv4/tcp_ipv4.c:910:15: error: unused variable 'size' [-Werror=unused-variable]
> 
> This does not show up when CONFIG_IPV6 is enabled, but the
> variable can be removed either way, along with the now unused
> assignment.
> 
> Fixes: 6797318e623d ("tcp: md5: add an address prefix for key lookup")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Applied, thanks.

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

end of thread, other threads:[~2017-06-21 16:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-20 20:11 [net-next PATCH] tcp: md5: hide unused variable Arnd Bergmann
2017-06-21 15:20 ` David Miller

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).