All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] tcp: remove the hardcode in the definition of TCPF Macro
@ 2018-02-20 13:28 Yafang Shao
  2018-02-21 18:39 ` Eric Dumazet
  2018-02-21 20:06 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Yafang Shao @ 2018-02-20 13:28 UTC (permalink / raw)
  To: davem; +Cc: netdev, linux-kernel, Yafang Shao

TCPF_ macro depends on the definition of TCP_ macro.
So it is better to define them with TCP_ marco.

Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
---
 include/net/tcp_states.h | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/include/net/tcp_states.h b/include/net/tcp_states.h
index 50e78a7..2875e16 100644
--- a/include/net/tcp_states.h
+++ b/include/net/tcp_states.h
@@ -32,21 +32,21 @@ enum {

 #define TCP_STATE_MASK	0xF

-#define TCP_ACTION_FIN	(1 << 7)
+#define TCP_ACTION_FIN	(1 << TCP_CLOSE)

 enum {
-	TCPF_ESTABLISHED = (1 << 1),
-	TCPF_SYN_SENT	 = (1 << 2),
-	TCPF_SYN_RECV	 = (1 << 3),
-	TCPF_FIN_WAIT1	 = (1 << 4),
-	TCPF_FIN_WAIT2	 = (1 << 5),
-	TCPF_TIME_WAIT	 = (1 << 6),
-	TCPF_CLOSE	 = (1 << 7),
-	TCPF_CLOSE_WAIT	 = (1 << 8),
-	TCPF_LAST_ACK	 = (1 << 9),
-	TCPF_LISTEN	 = (1 << 10),
-	TCPF_CLOSING	 = (1 << 11),
-	TCPF_NEW_SYN_RECV = (1 << 12),
+	TCPF_ESTABLISHED = (1 << TCP_ESTABLISHED),
+	TCPF_SYN_SENT	 = (1 << TCP_SYN_SENT),
+	TCPF_SYN_RECV	 = (1 << TCP_SYN_RECV),
+	TCPF_FIN_WAIT1	 = (1 << TCP_FIN_WAIT1),
+	TCPF_FIN_WAIT2	 = (1 << TCP_FIN_WAIT2),
+	TCPF_TIME_WAIT	 = (1 << TCP_TIME_WAIT),
+	TCPF_CLOSE	 = (1 << TCP_CLOSE),
+	TCPF_CLOSE_WAIT	 = (1 << TCP_CLOSE_WAIT),
+	TCPF_LAST_ACK	 = (1 << TCP_LAST_ACK),
+	TCPF_LISTEN	 = (1 << TCP_LISTEN),
+	TCPF_CLOSING	 = (1 << TCP_CLOSING),
+	TCPF_NEW_SYN_RECV = (1 << TCP_NEW_SYN_RECV),
 };

 #endif	/* _LINUX_TCP_STATES_H */
--
1.8.3.1

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

* Re: [PATCH net-next] tcp: remove the hardcode in the definition of TCPF Macro
  2018-02-20 13:28 [PATCH net-next] tcp: remove the hardcode in the definition of TCPF Macro Yafang Shao
@ 2018-02-21 18:39 ` Eric Dumazet
  2018-02-21 20:06 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Eric Dumazet @ 2018-02-21 18:39 UTC (permalink / raw)
  To: Yafang Shao, davem; +Cc: netdev, linux-kernel

On Tue, 2018-02-20 at 21:28 +0800, Yafang Shao wrote:
> TCPF_ macro depends on the definition of TCP_ macro.
> So it is better to define them with TCP_ marco.
> 
> Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
> ---

Seems reasonable, thanks !

Reviewed-by: Eric Dumazet <edumazet@google.com>

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

* Re: [PATCH net-next] tcp: remove the hardcode in the definition of TCPF Macro
  2018-02-20 13:28 [PATCH net-next] tcp: remove the hardcode in the definition of TCPF Macro Yafang Shao
  2018-02-21 18:39 ` Eric Dumazet
@ 2018-02-21 20:06 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2018-02-21 20:06 UTC (permalink / raw)
  To: laoar.shao; +Cc: netdev, linux-kernel

From: Yafang Shao <laoar.shao@gmail.com>
Date: Tue, 20 Feb 2018 21:28:31 +0800

> TCPF_ macro depends on the definition of TCP_ macro.
> So it is better to define them with TCP_ marco.
> 
> Signed-off-by: Yafang Shao <laoar.shao@gmail.com>

Applied, thank you.

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

end of thread, other threads:[~2018-02-21 20:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-20 13:28 [PATCH net-next] tcp: remove the hardcode in the definition of TCPF Macro Yafang Shao
2018-02-21 18:39 ` Eric Dumazet
2018-02-21 20:06 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.