diff mbox series

[v2,07/25] tcp: Use BIT() for OPTION_* constants

Message ID dc9dca0006fa1b586da44dcd54e29eb4300fe773.1635784253.git.cdleonard@gmail.com (mailing list archive)
State New
Headers show
Series [v2,01/25] tcp: authopt: Initial support and key management | expand

Commit Message

Leonard Crestez Nov. 1, 2021, 4:34 p.m. UTC
Extending these flags using the existing (1 << x) pattern triggers
complaints from checkpatch.

Instead of ignoring checkpatch modify the existing values to use BIT(x)
style in a separate commit.

Signed-off-by: Leonard Crestez <cdleonard@gmail.com>
---
 net/ipv4/tcp_output.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

Comments

David Ahern Nov. 3, 2021, 2:31 a.m. UTC | #1
On 11/1/21 10:34 AM, Leonard Crestez wrote:
> Extending these flags using the existing (1 << x) pattern triggers
> complaints from checkpatch.
> 
> Instead of ignoring checkpatch modify the existing values to use BIT(x)
> style in a separate commit.
> 
> Signed-off-by: Leonard Crestez <cdleonard@gmail.com>
> ---
>  net/ipv4/tcp_output.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 

This one could be sent outside of this patch set since you are not
adding new values. Patch sets > 20 are generally frowned upon; sending
this one separately helps get the number down.
Leonard Crestez Nov. 3, 2021, 10:19 p.m. UTC | #2
On 11/3/21 4:31 AM, David Ahern wrote:
> On 11/1/21 10:34 AM, Leonard Crestez wrote:
>> Extending these flags using the existing (1 << x) pattern triggers
>> complaints from checkpatch.
>>
>> Instead of ignoring checkpatch modify the existing values to use BIT(x)
>> style in a separate commit.
>>
>> Signed-off-by: Leonard Crestez <cdleonard@gmail.com>
>> ---
>>   net/ipv4/tcp_output.c | 14 +++++++-------
>>   1 file changed, 7 insertions(+), 7 deletions(-)
>>
> 
> This one could be sent outside of this patch set since you are not
> adding new values. Patch sets > 20 are generally frowned upon; sending
> this one separately helps get the number down.

In the past I've seen maintainers pick small cleanups and fixes from 
longer series that otherwise need further discussion.

Not sure if this practice is also common for netdev so I posted this 
patch separately.

--
Regards,
Leonard
diff mbox series

Patch

diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 6867e5db3e35..96f16386f50e 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -406,17 +406,17 @@  static void tcp_init_nondata_skb(struct sk_buff *skb, u32 seq, u8 flags)
 static inline bool tcp_urg_mode(const struct tcp_sock *tp)
 {
 	return tp->snd_una != tp->snd_up;
 }
 
-#define OPTION_SACK_ADVERTISE	(1 << 0)
-#define OPTION_TS		(1 << 1)
-#define OPTION_MD5		(1 << 2)
-#define OPTION_WSCALE		(1 << 3)
-#define OPTION_FAST_OPEN_COOKIE	(1 << 8)
-#define OPTION_SMC		(1 << 9)
-#define OPTION_MPTCP		(1 << 10)
+#define OPTION_SACK_ADVERTISE	BIT(0)
+#define OPTION_TS		BIT(1)
+#define OPTION_MD5		BIT(2)
+#define OPTION_WSCALE		BIT(3)
+#define OPTION_FAST_OPEN_COOKIE	BIT(8)
+#define OPTION_SMC		BIT(9)
+#define OPTION_MPTCP		BIT(10)
 
 static void smc_options_write(__be32 *ptr, u16 *options)
 {
 #if IS_ENABLED(CONFIG_SMC)
 	if (static_branch_unlikely(&tcp_have_smc)) {