git: bc107e4e5984 - stable/13 - sctp: remove some set, but unused variables

From: Michael Tuexen <tuexen_at_FreeBSD.org>
Date: Tue, 22 Feb 2022 22:34:32 UTC
The branch stable/13 has been updated by tuexen:

URL: https://cgit.FreeBSD.org/src/commit/?id=bc107e4e59841f7fbb2ee705a210317a0e887b72

commit bc107e4e59841f7fbb2ee705a210317a0e887b72
Author:     Michael Tuexen <tuexen@FreeBSD.org>
AuthorDate: 2021-08-09 13:58:46 +0000
Commit:     Michael Tuexen <tuexen@FreeBSD.org>
CommitDate: 2022-02-22 22:34:09 +0000

    sctp: remove some set, but unused variables
    
    Thanks to pkasting for submitting the patch for the userland stack.
    
    (cherry picked from commit 3808ab732e6a044cc101cf22027a0db2ac4ad58d)
---
 sys/netinet/sctp_cc_functions.c | 4 +---
 sys/netinet/sctp_output.c       | 4 +---
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/sys/netinet/sctp_cc_functions.c b/sys/netinet/sctp_cc_functions.c
index 7ad456d08d80..81b9e28f9959 100644
--- a/sys/netinet/sctp_cc_functions.c
+++ b/sys/netinet/sctp_cc_functions.c
@@ -685,7 +685,7 @@ sctp_cwnd_update_after_sack_common(struct sctp_tcb *stcb,
 {
 	struct sctp_nets *net;
 	int old_cwnd;
-	uint32_t t_ssthresh, t_cwnd, incr;
+	uint32_t t_ssthresh, incr;
 	uint64_t t_ucwnd_sbw;
 	uint64_t t_path_mptcp;
 	uint64_t mptcp_like_alpha;
@@ -694,7 +694,6 @@ sctp_cwnd_update_after_sack_common(struct sctp_tcb *stcb,
 
 	/* MT FIXME: Don't compute this over and over again */
 	t_ssthresh = 0;
-	t_cwnd = 0;
 	t_ucwnd_sbw = 0;
 	t_path_mptcp = 0;
 	mptcp_like_alpha = 1;
@@ -704,7 +703,6 @@ sctp_cwnd_update_after_sack_common(struct sctp_tcb *stcb,
 		max_path = 0;
 		TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) {
 			t_ssthresh += net->ssthresh;
-			t_cwnd += net->cwnd;
 			/* lastsa>>3;  we don't need to devide ... */
 			srtt = net->lastsa;
 			if (srtt > 0) {
diff --git a/sys/netinet/sctp_output.c b/sys/netinet/sctp_output.c
index 0f4ddd40753c..4fa2e8045258 100644
--- a/sys/netinet/sctp_output.c
+++ b/sys/netinet/sctp_output.c
@@ -12486,7 +12486,7 @@ sctp_lower_sosend(struct socket *so,
 {
 	struct epoch_tracker et;
 	ssize_t sndlen = 0, max_len, local_add_more;
-	int error, len;
+	int error;
 	struct mbuf *top = NULL;
 	int queue_only = 0, queue_only_for_init = 0;
 	int free_cnt_applied = 0;
@@ -13046,7 +13046,6 @@ sctp_lower_sosend(struct socket *so,
 		 */
 		local_add_more = sndlen;
 	}
-	len = 0;
 	if (non_blocking) {
 		goto skip_preblock;
 	}
@@ -13247,7 +13246,6 @@ skip_preblock:
 				}
 				sctp_snd_sb_alloc(stcb, sndout);
 				atomic_add_int(&sp->length, sndout);
-				len += sndout;
 				if (sinfo_flags & SCTP_SACK_IMMEDIATELY) {
 					sp->sinfo_flags |= SCTP_SACK_IMMEDIATELY;
 				}