Message ID | 20241017133435.2552-1-yajun.deng@linux.dev (mailing list archive) |
---|---|
State | Accepted |
Commit | 6886c14bdc309fa1c92b22f9587c5ca78f1920b7 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net-next] net: use sock_valbool_flag() only in __sock_set_timestamps() | expand |
Hello: This patch was applied to netdev/net-next.git (main) by Paolo Abeni <pabeni@redhat.com>: On Thu, 17 Oct 2024 21:34:35 +0800 you wrote: > sock_{,re}set_flag() are contained in sock_valbool_flag(), > it would be cleaner to just use sock_valbool_flag(). > > Signed-off-by: Yajun Deng <yajun.deng@linux.dev> > --- > net/core/sock.c | 7 ++----- > 1 file changed, 2 insertions(+), 5 deletions(-) Here is the summary with links: - [net-next] net: use sock_valbool_flag() only in __sock_set_timestamps() https://git.kernel.org/netdev/net-next/c/6886c14bdc30 You are awesome, thank you!
diff --git a/net/core/sock.c b/net/core/sock.c index f8c0d4eda888..49337da24701 100644 --- a/net/core/sock.c +++ b/net/core/sock.c @@ -820,14 +820,11 @@ EXPORT_SYMBOL(sock_set_sndtimeo); static void __sock_set_timestamps(struct sock *sk, bool val, bool new, bool ns) { + sock_valbool_flag(sk, SOCK_RCVTSTAMP, val); + sock_valbool_flag(sk, SOCK_RCVTSTAMPNS, val && ns); if (val) { sock_valbool_flag(sk, SOCK_TSTAMP_NEW, new); - sock_valbool_flag(sk, SOCK_RCVTSTAMPNS, ns); - sock_set_flag(sk, SOCK_RCVTSTAMP); sock_enable_timestamp(sk, SOCK_TIMESTAMP); - } else { - sock_reset_flag(sk, SOCK_RCVTSTAMP); - sock_reset_flag(sk, SOCK_RCVTSTAMPNS); } }
sock_{,re}set_flag() are contained in sock_valbool_flag(), it would be cleaner to just use sock_valbool_flag(). Signed-off-by: Yajun Deng <yajun.deng@linux.dev> --- net/core/sock.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)