All of lore.kernel.org
 help / color / mirror / Atom feed
From: Geliang Tang <geliang.tang@suse.com>
To: mptcp@lists.linux.dev
Cc: Geliang Tang <geliang.tang@suse.com>
Subject: [PATCH mptcp-next v9 1/5] mptcp: move the declarations of ssk and subflow
Date: Mon, 10 Jan 2022 17:08:18 +0800	[thread overview]
Message-ID: <935c92627ac820e2a2544a4d79af0c6254a629f1.1641804767.git.geliang.tang@suse.com> (raw)
In-Reply-To: <cover.1641804767.git.geliang.tang@suse.com>

Move the declarations of ssk and subflow in MP_FAIL and MP_PRIO to the
beginning of the function mptcp_write_options().

Signed-off-by: Geliang Tang <geliang.tang@suse.com>
---
 net/mptcp/options.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/net/mptcp/options.c b/net/mptcp/options.c
index bbf61dedb4b5..3230166d6f83 100644
--- a/net/mptcp/options.c
+++ b/net/mptcp/options.c
@@ -1264,10 +1264,10 @@ static u16 mptcp_make_csum(const struct mptcp_ext *mpext)
 void mptcp_write_options(__be32 *ptr, const struct tcp_sock *tp,
 			 struct mptcp_out_options *opts)
 {
-	if (unlikely(OPTION_MPTCP_FAIL & opts->suboptions)) {
-		const struct sock *ssk = (const struct sock *)tp;
-		struct mptcp_subflow_context *subflow;
+	const struct sock *ssk = (const struct sock *)tp;
+	struct mptcp_subflow_context *subflow;
 
+	if (unlikely(OPTION_MPTCP_FAIL & opts->suboptions)) {
 		subflow = mptcp_subflow_ctx(ssk);
 		subflow->send_mp_fail = 0;
 
@@ -1489,9 +1489,6 @@ void mptcp_write_options(__be32 *ptr, const struct tcp_sock *tp,
 	}
 
 	if (OPTION_MPTCP_PRIO & opts->suboptions) {
-		const struct sock *ssk = (const struct sock *)tp;
-		struct mptcp_subflow_context *subflow;
-
 		subflow = mptcp_subflow_ctx(ssk);
 		subflow->send_mp_prio = 0;
 
-- 
2.31.1


  reply	other threads:[~2022-01-10  9:08 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-10  9:08 [PATCH mptcp-next v9 0/5] Clarify when options can be used Geliang Tang
2022-01-10  9:08 ` Geliang Tang [this message]
2022-01-10  9:08 ` [PATCH mptcp-next v9 2/5] mptcp: reduce branching when writing MP_FAIL option Geliang Tang
2022-01-10  9:08 ` [PATCH mptcp-next v9 3/5] mptcp: clarify when options can be used Geliang Tang
2022-01-10  9:08 ` [PATCH mptcp-next v9 4/5] mptcp: print out reset infos of MP_RST Geliang Tang
2022-01-10  9:08 ` [PATCH mptcp-next v9 5/5] selftests: mptcp: add mp_fail testcases Geliang Tang
2022-01-13  1:06   ` Mat Martineau
2022-01-13 10:36     ` Matthieu Baerts
2022-01-13 17:09     ` Mat Martineau
2022-01-18 13:32       ` Davide Caratti
2022-01-18 14:15         ` Matthieu Baerts
2022-01-18 16:48           ` Davide Caratti
2022-01-18 22:22             ` Mat Martineau
2022-01-19 10:32             ` Matthieu Baerts
2022-01-12 23:33 ` [PATCH mptcp-next v9 0/5] Clarify when options can be used Mat Martineau
2022-01-13 10:41   ` Matthieu Baerts

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=935c92627ac820e2a2544a4d79af0c6254a629f1.1641804767.git.geliang.tang@suse.com \
    --to=geliang.tang@suse.com \
    --cc=mptcp@lists.linux.dev \
    /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: link
Be 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.