From: Kuniyuki Iwashima <kuniyu@amazon.co.jp> To: "David S . Miller" <davem@davemloft.net>, Jakub Kicinski <kuba@kernel.org>, Eric Dumazet <edumazet@google.com>, Gerrit Renker <gerrit@erg.abdn.ac.uk>, Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>, "Hideaki YOSHIFUJI" <yoshfuji@linux-ipv6.org> Cc: <dccp@vger.kernel.org>, <netdev@vger.kernel.org>, Kuniyuki Iwashima <kuni1840@gmail.com>, Kuniyuki Iwashima <kuniyu@amazon.co.jp>, <osa-contribution-log@amazon.com> Subject: [PATCH net-next 2/2] tcp/dccp: Remove unnecessary initialization of refcounted. Date: Tue, 24 Mar 2020 03:18:14 +0900 [thread overview] Message-ID: <20200323181814.87661-3-kuniyu@amazon.co.jp> (raw) In-Reply-To: <20200323181814.87661-1-kuniyu@amazon.co.jp> When we get a TCP_NEW_SYN_RECV/DCCP_NEW_SYN_RECV socket by __inet_lookup_skb(), refcounted is already set true, so it is not necessary to do it again. Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.co.jp> --- net/dccp/ipv4.c | 1 - net/dccp/ipv6.c | 1 - net/ipv4/tcp_ipv4.c | 1 - net/ipv6/tcp_ipv6.c | 1 - 4 files changed, 4 deletions(-) diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c index d19557c6d04b..c63b6bd68284 100644 --- a/net/dccp/ipv4.c +++ b/net/dccp/ipv4.c @@ -838,7 +838,6 @@ static int dccp_v4_rcv(struct sk_buff *skb) goto lookup; } sock_hold(sk); - refcounted = true; nsk = dccp_check_req(sk, skb, req); if (!nsk) { reqsk_put(req); diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c index 1e5e08cc0bfc..b3ca9b1ef32a 100644 --- a/net/dccp/ipv6.c +++ b/net/dccp/ipv6.c @@ -740,7 +740,6 @@ static int dccp_v6_rcv(struct sk_buff *skb) goto lookup; } sock_hold(sk); - refcounted = true; nsk = dccp_check_req(sk, skb, req); if (!nsk) { reqsk_put(req); diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index df1166b76126..b59a89d8fa69 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c @@ -1931,7 +1931,6 @@ int tcp_v4_rcv(struct sk_buff *skb) * as we might lose it too soon. */ sock_hold(sk); - refcounted = true; nsk = NULL; if (!tcp_filter(sk, skb)) { th = (const struct tcphdr *)skb->data; diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index eaf09e6b7844..3a587c40ca52 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c @@ -1603,7 +1603,6 @@ INDIRECT_CALLABLE_SCOPE int tcp_v6_rcv(struct sk_buff *skb) goto lookup; } sock_hold(sk); - refcounted = true; nsk = NULL; if (!tcp_filter(sk, skb)) { th = (const struct tcphdr *)skb->data; -- 2.17.2 (Apple Git-113)
WARNING: multiple messages have this Message-ID (diff)
From: Kuniyuki Iwashima <kuniyu@amazon.co.jp> To: dccp@vger.kernel.org Subject: [PATCH net-next 2/2] tcp/dccp: Remove unnecessary initialization of refcounted. Date: Mon, 23 Mar 2020 18:18:14 +0000 [thread overview] Message-ID: <20200323181814.87661-3-kuniyu@amazon.co.jp> (raw) When we get a TCP_NEW_SYN_RECV/DCCP_NEW_SYN_RECV socket by __inet_lookup_skb(), refcounted is already set true, so it is not necessary to do it again. Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.co.jp> --- net/dccp/ipv4.c | 1 - net/dccp/ipv6.c | 1 - net/ipv4/tcp_ipv4.c | 1 - net/ipv6/tcp_ipv6.c | 1 - 4 files changed, 4 deletions(-) diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c index d19557c6d04b..c63b6bd68284 100644 --- a/net/dccp/ipv4.c +++ b/net/dccp/ipv4.c @@ -838,7 +838,6 @@ static int dccp_v4_rcv(struct sk_buff *skb) goto lookup; } sock_hold(sk); - refcounted = true; nsk = dccp_check_req(sk, skb, req); if (!nsk) { reqsk_put(req); diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c index 1e5e08cc0bfc..b3ca9b1ef32a 100644 --- a/net/dccp/ipv6.c +++ b/net/dccp/ipv6.c @@ -740,7 +740,6 @@ static int dccp_v6_rcv(struct sk_buff *skb) goto lookup; } sock_hold(sk); - refcounted = true; nsk = dccp_check_req(sk, skb, req); if (!nsk) { reqsk_put(req); diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index df1166b76126..b59a89d8fa69 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c @@ -1931,7 +1931,6 @@ int tcp_v4_rcv(struct sk_buff *skb) * as we might lose it too soon. */ sock_hold(sk); - refcounted = true; nsk = NULL; if (!tcp_filter(sk, skb)) { th = (const struct tcphdr *)skb->data; diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index eaf09e6b7844..3a587c40ca52 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c @@ -1603,7 +1603,6 @@ INDIRECT_CALLABLE_SCOPE int tcp_v6_rcv(struct sk_buff *skb) goto lookup; } sock_hold(sk); - refcounted = true; nsk = NULL; if (!tcp_filter(sk, skb)) { th = (const struct tcphdr *)skb->data; -- 2.17.2 (Apple Git-113)
next prev parent reply other threads:[~2020-03-23 18:22 UTC|newest] Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-03-23 18:18 [PATCH net-next 0/2] tcp/dccp: Cleanup initialisation code of refcounted Kuniyuki Iwashima 2020-03-23 18:18 ` Kuniyuki Iwashima 2020-03-23 18:18 ` [PATCH net-next 1/2] tcp/dccp: Move initialisation of refcounted into if block Kuniyuki Iwashima 2020-03-23 18:18 ` Kuniyuki Iwashima 2020-03-23 18:45 ` Eric Dumazet 2020-03-23 18:45 ` Eric Dumazet 2020-03-24 11:10 ` [PATCH net-next 1/2] tcp/dccp: Move initialisation of refcounted Kuniyuki Iwashima 2020-03-24 11:10 ` Kuniyuki Iwashima 2020-03-23 18:18 ` Kuniyuki Iwashima [this message] 2020-03-23 18:18 ` [PATCH net-next 2/2] tcp/dccp: Remove unnecessary initialization " Kuniyuki Iwashima 2020-03-23 18:47 ` Eric Dumazet 2020-03-23 18:47 ` Eric Dumazet 2020-03-24 11:06 ` [PATCH net-next 2/2] tcp/dccp: Remove unnecessary initialization Kuniyuki Iwashima 2020-03-24 11:06 ` Kuniyuki Iwashima
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20200323181814.87661-3-kuniyu@amazon.co.jp \ --to=kuniyu@amazon.co.jp \ --cc=davem@davemloft.net \ --cc=dccp@vger.kernel.org \ --cc=edumazet@google.com \ --cc=gerrit@erg.abdn.ac.uk \ --cc=kuba@kernel.org \ --cc=kuni1840@gmail.com \ --cc=kuznet@ms2.inr.ac.ru \ --cc=netdev@vger.kernel.org \ --cc=osa-contribution-log@amazon.com \ --cc=yoshfuji@linux-ipv6.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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.