All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tcp: don't use __constant_cpu_to_be32
@ 2019-03-14  6:15 Sergey Senozhatsky
  2019-03-14 12:42 ` Eric Dumazet
  0 siblings, 1 reply; 10+ messages in thread
From: Sergey Senozhatsky @ 2019-03-14  6:15 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: netdev, linux-kernel, Sergey Senozhatsky

A trivial patch.

cpu_to_be32() is capable enough to detect __builtin_constant_p()
and to use an appropriate compile time ___constant_swahb32()
function.

So we can use cpu_to_be32() instead of __constant_cpu_to_be32().

Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
---
 include/uapi/linux/tcp.h | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/include/uapi/linux/tcp.h b/include/uapi/linux/tcp.h
index 8bb6cc5f3235..7d2330df9652 100644
--- a/include/uapi/linux/tcp.h
+++ b/include/uapi/linux/tcp.h
@@ -70,16 +70,16 @@ union tcp_word_hdr {
 #define tcp_flag_word(tp) ( ((union tcp_word_hdr *)(tp))->words [3]) 
 
 enum { 
-	TCP_FLAG_CWR = __constant_cpu_to_be32(0x00800000),
-	TCP_FLAG_ECE = __constant_cpu_to_be32(0x00400000),
-	TCP_FLAG_URG = __constant_cpu_to_be32(0x00200000),
-	TCP_FLAG_ACK = __constant_cpu_to_be32(0x00100000),
-	TCP_FLAG_PSH = __constant_cpu_to_be32(0x00080000),
-	TCP_FLAG_RST = __constant_cpu_to_be32(0x00040000),
-	TCP_FLAG_SYN = __constant_cpu_to_be32(0x00020000),
-	TCP_FLAG_FIN = __constant_cpu_to_be32(0x00010000),
-	TCP_RESERVED_BITS = __constant_cpu_to_be32(0x0F000000),
-	TCP_DATA_OFFSET = __constant_cpu_to_be32(0xF0000000)
+	TCP_FLAG_CWR = cpu_to_be32(0x00800000),
+	TCP_FLAG_ECE = cpu_to_be32(0x00400000),
+	TCP_FLAG_URG = cpu_to_be32(0x00200000),
+	TCP_FLAG_ACK = cpu_to_be32(0x00100000),
+	TCP_FLAG_PSH = cpu_to_be32(0x00080000),
+	TCP_FLAG_RST = cpu_to_be32(0x00040000),
+	TCP_FLAG_SYN = cpu_to_be32(0x00020000),
+	TCP_FLAG_FIN = cpu_to_be32(0x00010000),
+	TCP_RESERVED_BITS = cpu_to_be32(0x0F000000),
+	TCP_DATA_OFFSET = cpu_to_be32(0xF0000000)
 }; 
 
 /*
-- 
2.21.0


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

end of thread, other threads:[~2019-03-19  1:29 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-14  6:15 [PATCH] tcp: don't use __constant_cpu_to_be32 Sergey Senozhatsky
2019-03-14 12:42 ` Eric Dumazet
2019-03-15  1:20   ` Sergey Senozhatsky
2019-03-15 17:24     ` Stanislav Fomichev
2019-03-16  5:19       ` Sergey Senozhatsky
2019-03-16  7:18         ` Sergey Senozhatsky
2019-03-16 14:26         ` Sergey Senozhatsky
2019-03-18 16:32           ` Stanislav Fomichev
2019-03-19  1:29             ` Sergey Senozhatsky
2019-03-18 16:28         ` Stanislav Fomichev

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.