diff mbox series

[mptcp-next,2/2] Squash to "mptcp: add sched_data helpers"

Message ID 20250221-mptcp-sched-data-ptr-v1-2-dbaec476fa6b@kernel.org (mailing list archive)
State Accepted, archived
Commit f3c111c797d2a4029b6e2018e6cf6644d679273d
Delegated to: Matthieu Baerts
Headers show
Series mptcp: sched: reduce size for unused data | expand

Checks

Context Check Description
matttbe/build success Build and static analysis OK
matttbe/checkpatch success total: 0 errors, 0 warnings, 0 checks, 41 lines checked
matttbe/shellcheck success MPTCP selftests files have not been modified
matttbe/KVM_Validation__normal success Success! ✅
matttbe/KVM_Validation__debug success Success! ✅
matttbe/KVM_Validation__btf-normal__only_bpftest_all_ success Success! ✅
matttbe/KVM_Validation__btf-debug__only_bpftest_all_ success Success! ✅

Commit Message

Matthieu Baerts Feb. 21, 2025, 3:08 p.m. UTC
"mptcp: add sched_data helpers" can be removed when "use bpf_iter in bpf
schedulers" series will be applied.

Same for the mptcp_sched_data structure.

Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
 net/mptcp/sched.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
diff mbox series

Patch

diff --git a/net/mptcp/sched.c b/net/mptcp/sched.c
index c8e08f6c300d37584d3d89a01022b5677aa8b6bb..37d86aadaeaa523568a82ffb22254d1fb34a3d2d 100644
--- a/net/mptcp/sched.c
+++ b/net/mptcp/sched.c
@@ -177,7 +177,7 @@  static void mptcp_sched_data_set_contexts(const struct mptcp_sock *msk,
 int mptcp_sched_get_send(struct mptcp_sock *msk)
 {
 	struct mptcp_subflow_context *subflow;
-	struct mptcp_sched_data *data = NULL;
+	struct mptcp_sched_data data;
 
 	msk_owned_by_me(msk);
 
@@ -198,15 +198,15 @@  int mptcp_sched_get_send(struct mptcp_sock *msk)
 	}
 
 	if (msk->sched == &mptcp_sched_default || !msk->sched)
-		return mptcp_sched_default_get_send(msk, data);
-	mptcp_sched_data_set_contexts(msk, data);
-	return msk->sched->get_send(msk, data);
+		return mptcp_sched_default_get_send(msk, &data);
+	mptcp_sched_data_set_contexts(msk, &data);
+	return msk->sched->get_send(msk, &data);
 }
 
 int mptcp_sched_get_retrans(struct mptcp_sock *msk)
 {
 	struct mptcp_subflow_context *subflow;
-	struct mptcp_sched_data *data = NULL;
+	struct mptcp_sched_data data;
 
 	msk_owned_by_me(msk);
 
@@ -220,10 +220,10 @@  int mptcp_sched_get_retrans(struct mptcp_sock *msk)
 	}
 
 	if (msk->sched == &mptcp_sched_default || !msk->sched)
-		return mptcp_sched_default_get_retrans(msk, data);
+		return mptcp_sched_default_get_retrans(msk, &data);
 
-	mptcp_sched_data_set_contexts(msk, data);
+	mptcp_sched_data_set_contexts(msk, &data);
 	if (msk->sched->get_retrans)
-		return msk->sched->get_retrans(msk, data);
-	return msk->sched->get_send(msk, data);
+		return msk->sched->get_retrans(msk, &data);
+	return msk->sched->get_send(msk, &data);
 }