[net-next PATCH] tcp: remove useless assignment statement in tcp_keepalive_timer

Subsystems: networking [general], networking [tcp], the rest

STALE5530d

3 messages, 2 authors, 2011-08-22 · open the first message on its own page

[net-next PATCH] tcp: remove useless assignment statement in tcp_keepalive_timer

From: Li Yu <hidden>
Date: 2011-08-22 10:03:23

Remove useless assignment statement, it may be trash after refactoring?

Signed-off-by: Li Yu <redacted>
diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c
index ecd44b0..321ff2f 100644
--- a/net/ipv4/tcp_timer.c
+++ b/net/ipv4/tcp_timer.c
@@ -552,8 +552,6 @@ static void tcp_keepalive_timer (unsigned long data)
 	if (!sock_flag(sk, SOCK_KEEPOPEN) || sk->sk_state == TCP_CLOSE)
 		goto out;
 
-	elapsed = keepalive_time_when(tp);
-
 	/* It is alive without keepalive 8) */
 	if (tp->packets_out || tcp_send_head(sk))
 		goto resched;

Re: [net-next PATCH] tcp: remove useless assignment statement in tcp_keepalive_timer

From: Christoph Paasch <hidden>
Date: 2011-08-22 10:54:16

No, if the condition afterwards evaluates to TRUE, and we go to the label 
resched, inet_csk_reset_keepalive_timer(...) is called without elapsed being 
set.

Cheers,
Christoph

On Monday 22 August 2011 wrote Li Yu:
quoted hunk
Remove useless assignment statement, it may be trash after refactoring?

Signed-off-by: Li Yu <redacted>
diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c
index ecd44b0..321ff2f 100644
--- a/net/ipv4/tcp_timer.c
+++ b/net/ipv4/tcp_timer.c
@@ -552,8 +552,6 @@ static void tcp_keepalive_timer (unsigned long data)
 	if (!sock_flag(sk, SOCK_KEEPOPEN) || sk->sk_state == TCP_CLOSE)
 		goto out;

-	elapsed = keepalive_time_when(tp);
-
 	/* It is alive without keepalive 8) */
 	if (tp->packets_out || tcp_send_head(sk))
 		goto resched;

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
Christoph Paasch
PhD Student

IP Networking Lab --- http://inl.info.ucl.ac.be
MultiPath TCP in the Linux Kernel --- http://inl.info.ucl.ac.be/mptcp
Université Catholique de Louvain

www.rollerbulls.be
--

Re: [net-next PATCH] tcp: remove useless assignment statement in tcp_keepalive_timer

From: Li Yu <hidden>
Date: 2011-08-22 11:01:26

Oops, thanks for reminding !

Yu

于 2011年08月22日 18:46, Christoph Paasch 写道:
No, if the condition afterwards evaluates to TRUE, and we go to the label 
resched, inet_csk_reset_keepalive_timer(...) is called without elapsed being 
set.

Cheers,
Christoph

On Monday 22 August 2011 wrote Li Yu:
quoted
Remove useless assignment statement, it may be trash after refactoring?

Signed-off-by: Li Yu <redacted>
diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c
index ecd44b0..321ff2f 100644
--- a/net/ipv4/tcp_timer.c
+++ b/net/ipv4/tcp_timer.c
@@ -552,8 +552,6 @@ static void tcp_keepalive_timer (unsigned long data)
 	if (!sock_flag(sk, SOCK_KEEPOPEN) || sk->sk_state == TCP_CLOSE)
 		goto out;

-	elapsed = keepalive_time_when(tp);
-
 	/* It is alive without keepalive 8) */
 	if (tp->packets_out || tcp_send_head(sk))
 		goto resched;

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
Christoph Paasch
PhD Student

IP Networking Lab --- http://inl.info.ucl.ac.be
MultiPath TCP in the Linux Kernel --- http://inl.info.ucl.ac.be/mptcp
Université Catholique de Louvain

www.rollerbulls.be
--
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help