Skip to contentSkip to conversation

tcp: Remove unused but set variable

PATCH Applied Tobias Klauser 2 participants 2 messages Oct 18, 2016

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tcp: Remove unused but set variable

Remove the unused but set variable icsk in listening_get_next to fix the following GCC warning when building with 'W=1':

net/ipv4/tcp_ipv4.c: In function ‘listening_get_next’:
net/ipv4/tcp_ipv4.c:1890:31: warning: variable ‘icsk’ set but not used [-Wunused-but-set-variable]

---
 net/ipv4/tcp_ipv4.c | 2 --
 1 file changed, 2 deletions(-)
net/ipv4/tcp_ipv4.c +0 -2
index bd5e8d10893f..79d55eb3ec3f 100644
@@ -1887,7 +1887,6 @@ static void *listening_get_next(struct seq_file *seq, void *cur)
 	struct tcp_iter_state *st = seq->private;
 	struct net *net = seq_file_net(seq);
 	struct inet_listen_hashbucket *ilb;
-	struct inet_connection_sock *icsk;
 	struct sock *sk = cur;
 
 	if (!sk) {
@@ -1909,7 +1908,6 @@ static void *listening_get_next(struct seq_file *seq, void *cur)
 			continue;
 		if (sk->sk_family == st->family)
 			return sk;
-		icsk = inet_csk(sk);
 	}
 	spin_unlock_bh(&ilb->lock);
 	st->offset = 0;
Signature · 1 line
2.9.0
maintainer Applied
#1 lore raw

From: Tobias Klauser <[email protected]>
Date: Tue, 18 Oct 2016 11:22:54 +0200

Quoted 7 lines

Remove the unused but set variable icsk in listening_get_next to fix the following GCC warning when building with 'W=1':

net/ipv4/tcp_ipv4.c: In function ‘listening_get_next’:
net/ipv4/tcp_ipv4.c:1890:31: warning: variable ‘icsk’ set but not used [-Wunused-but-set-variable]

Applied.