netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 1/2] tcp: remove an unnecessary check in tcp_tx_timestamp
@ 2016-04-25 20:51 Soheil Hassas Yeganeh
  2016-04-25 20:51 ` [PATCH net-next 2/2] tcp: remove a redundant check for SKBTX_ACK_TSTAMP Soheil Hassas Yeganeh
  0 siblings, 1 reply; 4+ messages in thread
From: Soheil Hassas Yeganeh @ 2016-04-25 20:51 UTC (permalink / raw)
  To: davem, netdev
  Cc: kafai, willemb, edumazet, ycheng, ncardwell,
	Soheil Hassas Yeganeh

From: Soheil Hassas Yeganeh <soheil@google.com>

tcp_tx_timestamp() receives tsflags as a parameter. tsflags
is initialized to sk->sk_tsflags and is overridden by control
messages. As a result the "sk->sk_tsflags || tsflags" is the
same expression as "tsflags"

Remove the redundant check for sk->sk_tsflags in tcp_tx_timestamp.

Signed-off-by: Soheil Hassas Yeganeh <soheil@google.com>
---
 net/ipv4/tcp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 4d73858..3c542dc 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -430,7 +430,7 @@ EXPORT_SYMBOL(tcp_init_sock);
 
 static void tcp_tx_timestamp(struct sock *sk, u16 tsflags, struct sk_buff *skb)
 {
-	if (sk->sk_tsflags || tsflags) {
+	if (tsflags) {
 		struct skb_shared_info *shinfo = skb_shinfo(skb);
 		struct tcp_skb_cb *tcb = TCP_SKB_CB(skb);
 
-- 
2.8.0.rc3.226.g39d4020

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

end of thread, other threads:[~2016-04-27 19:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-25 20:51 [PATCH net-next 1/2] tcp: remove an unnecessary check in tcp_tx_timestamp Soheil Hassas Yeganeh
2016-04-25 20:51 ` [PATCH net-next 2/2] tcp: remove a redundant check for SKBTX_ACK_TSTAMP Soheil Hassas Yeganeh
2016-04-27 18:19   ` Martin KaFai Lau
2016-04-27 19:25     ` Soheil Hassas Yeganeh

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