From 53579bef8238d109a489f9868e73b2274e190cf5 Mon Sep 17 00:00:00 2001 From: Michael Tuexen Date: Wed, 7 Oct 2020 17:39:17 +0200 Subject: [PATCH] Whitespace changes --- usrsctplib/netinet/sctp_cc_functions.c | 16 ++++++++-------- usrsctplib/netinet/sctp_indata.c | 6 +++--- usrsctplib/netinet/sctp_input.c | 2 +- usrsctplib/netinet/sctp_output.c | 19 +++++++++---------- usrsctplib/netinet/sctp_pcb.c | 4 ++-- usrsctplib/netinet/sctp_usrreq.c | 2 +- usrsctplib/netinet/sctputil.c | 2 +- usrsctplib/netinet6/sctp6_usrreq.c | 2 +- 8 files changed, 26 insertions(+), 27 deletions(-) diff --git a/usrsctplib/netinet/sctp_cc_functions.c b/usrsctplib/netinet/sctp_cc_functions.c index 6cbc3dbce..57bcdaaa5 100755 --- a/usrsctplib/netinet/sctp_cc_functions.c +++ b/usrsctplib/netinet/sctp_cc_functions.c @@ -34,7 +34,7 @@ #if defined(__FreeBSD__) && !defined(__Userspace__) #include -__FBSDID("$FreeBSD: head/sys/netinet/sctp_cc_functions.c 366114 2020-09-24 12:26:06Z tuexen $"); +__FBSDID("$FreeBSD: head/sys/netinet/sctp_cc_functions.c 366517 2020-10-07 15:22:48Z tuexen $"); #endif #include @@ -2070,19 +2070,19 @@ htcp_alpha_update(struct htcp *ca) if (diff > (uint32_t)hz) { diff -= hz; - factor = 1+ ( 10*diff + ((diff/2)*(diff/2)/hz))/hz; + factor = 1+ (10 * diff + ((diff / 2) * (diff / 2) / hz)) / hz; } if (use_rtt_scaling && minRTT) { - uint32_t scale = (hz<<3)/(10*minRTT); - scale = min(max(scale, 1U<<2), 10U<<3); /* clamping ratio to interval [0.5,10]<<3 */ - factor = (factor<<3)/scale; - if (!factor) + uint32_t scale = (hz << 3) / (10 * minRTT); + scale = min(max(scale, 1U << 2), 10U << 3); /* clamping ratio to interval [0.5,10]<<3 */ + factor = (factor << 3) / scale; + if (factor != 0) factor = 1; } - ca->alpha = 2*factor*((1<<7)-ca->beta); - if (!ca->alpha) + ca->alpha = 2 * factor * ((1 << 7) - ca->beta); + if (ca->alpha != 0) ca->alpha = ALPHA_BASE; } diff --git a/usrsctplib/netinet/sctp_indata.c b/usrsctplib/netinet/sctp_indata.c index 41beac019..251cdad45 100755 --- a/usrsctplib/netinet/sctp_indata.c +++ b/usrsctplib/netinet/sctp_indata.c @@ -1121,7 +1121,7 @@ sctp_deliver_reasm_check(struct sctp_tcb *stcb, struct sctp_association *asoc, /* We just put the last bit on */ if (control->on_strm_q) { #ifdef INVARIANTS - if (control->on_strm_q != SCTP_ON_UNORDERED ) { + if (control->on_strm_q != SCTP_ON_UNORDERED) { panic("Huh control: %p on_q: %d -- not unordered?", control, control->on_strm_q); } @@ -1185,7 +1185,7 @@ sctp_deliver_reasm_check(struct sctp_tcb *stcb, struct sctp_association *asoc, if (control->end_added) { if (control->on_strm_q) { #ifdef INVARIANTS - if (control->on_strm_q != SCTP_ON_ORDERED ) { + if (control->on_strm_q != SCTP_ON_ORDERED) { panic("Huh control: %p on_q: %d -- not ordered?", control, control->on_strm_q); } @@ -1238,7 +1238,7 @@ sctp_deliver_reasm_check(struct sctp_tcb *stcb, struct sctp_association *asoc, /* We are done with it afterwards */ if (control->on_strm_q) { #ifdef INVARIANTS - if (control->on_strm_q != SCTP_ON_ORDERED ) { + if (control->on_strm_q != SCTP_ON_ORDERED) { panic("Huh control: %p on_q: %d -- not ordered?", control, control->on_strm_q); } diff --git a/usrsctplib/netinet/sctp_input.c b/usrsctplib/netinet/sctp_input.c index dfbdb532e..582ad0b7d 100755 --- a/usrsctplib/netinet/sctp_input.c +++ b/usrsctplib/netinet/sctp_input.c @@ -3906,7 +3906,7 @@ sctp_handle_stream_reset_response(struct sctp_tcb *stcb, if (action == SCTP_STREAM_RESET_RESULT_PERFORMED) { /* Put the new streams into effect */ int i; - for ( i = asoc->streamoutcnt; i< (asoc->streamoutcnt + num_stream); i++) { + for (i = asoc->streamoutcnt; i < (asoc->streamoutcnt + num_stream); i++) { asoc->strmout[i].state = SCTP_STREAM_OPEN; } asoc->streamoutcnt += num_stream; diff --git a/usrsctplib/netinet/sctp_output.c b/usrsctplib/netinet/sctp_output.c index 9761e2e45..8b6fa0ef7 100755 --- a/usrsctplib/netinet/sctp_output.c +++ b/usrsctplib/netinet/sctp_output.c @@ -34,7 +34,7 @@ #if defined(__FreeBSD__) && !defined(__Userspace__) #include -__FBSDID("$FreeBSD: head/sys/netinet/sctp_output.c 366482 2020-10-06 11:08:52Z tuexen $"); +__FBSDID("$FreeBSD: head/sys/netinet/sctp_output.c 366517 2020-10-07 15:22:48Z tuexen $"); #endif #include @@ -2659,7 +2659,7 @@ sctp_choose_boundspecific_stcb(struct sctp_inpcb *inp, ifn = SCTP_GET_IFN_VOID_FROM_ROUTE(ro); ifn_index = SCTP_GET_IF_INDEX_FROM_ROUTE(ro); - sctp_ifn = sctp_find_ifn( ifn, ifn_index); + sctp_ifn = sctp_find_ifn(ifn, ifn_index); /* * first question, is the ifn we will emit on in our list? If so, @@ -2830,14 +2830,13 @@ sctp_select_nth_preferred_addr_from_ifn_boundall(struct sctp_ifn *ifn, #else struct sctp_inpcb *inp SCTP_UNUSED, #endif - struct sctp_tcb *stcb, - int non_asoc_addr_ok, - uint8_t dest_is_loop, - uint8_t dest_is_priv, - int addr_wanted, - sa_family_t fam, - sctp_route_t *ro - ) + struct sctp_tcb *stcb, + int non_asoc_addr_ok, + uint8_t dest_is_loop, + uint8_t dest_is_priv, + int addr_wanted, + sa_family_t fam, + sctp_route_t *ro) { struct sctp_ifa *ifa, *sifa; int num_eligible_addr = 0; diff --git a/usrsctplib/netinet/sctp_pcb.c b/usrsctplib/netinet/sctp_pcb.c index a26ab7a72..89a66bce8 100755 --- a/usrsctplib/netinet/sctp_pcb.c +++ b/usrsctplib/netinet/sctp_pcb.c @@ -7770,7 +7770,7 @@ sctp_drain_mbufs(struct sctp_tcb *stcb) for (strmat = 0; strmat < asoc->streamincnt; strmat++) { TAILQ_FOREACH_SAFE(control, &asoc->strmin[strmat].inqueue, next_instrm, ncontrol) { #ifdef INVARIANTS - if (control->on_strm_q != SCTP_ON_ORDERED ) { + if (control->on_strm_q != SCTP_ON_ORDERED) { panic("Huh control: %p on_q: %d -- not ordered?", control, control->on_strm_q); } @@ -7830,7 +7830,7 @@ sctp_drain_mbufs(struct sctp_tcb *stcb) } TAILQ_FOREACH_SAFE(control, &asoc->strmin[strmat].uno_inqueue, next_instrm, ncontrol) { #ifdef INVARIANTS - if (control->on_strm_q != SCTP_ON_UNORDERED ) { + if (control->on_strm_q != SCTP_ON_UNORDERED) { panic("Huh control: %p on_q: %d -- not unordered?", control, control->on_strm_q); } diff --git a/usrsctplib/netinet/sctp_usrreq.c b/usrsctplib/netinet/sctp_usrreq.c index 343dcefae..f287f30f1 100755 --- a/usrsctplib/netinet/sctp_usrreq.c +++ b/usrsctplib/netinet/sctp_usrreq.c @@ -5644,7 +5644,7 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize, break; } /* Do any streams have data queued? */ - for ( i = 0; i< stcb->asoc.streamoutcnt; i++) { + for (i = 0; i < stcb->asoc.streamoutcnt; i++) { if (!TAILQ_EMPTY(&stcb->asoc.strmout[i].outqueue)) { goto busy_out; } diff --git a/usrsctplib/netinet/sctputil.c b/usrsctplib/netinet/sctputil.c index 778e8f945..41910ec49 100755 --- a/usrsctplib/netinet/sctputil.c +++ b/usrsctplib/netinet/sctputil.c @@ -2173,7 +2173,7 @@ sctp_timeout_handler(void *t) if (inp != NULL) sctp_auditing(5, inp, stcb, net); #endif - if (did_output && (stcb != NULL) ) { + if (did_output && (stcb != NULL)) { /* * Now we need to clean up the control chunk chain if an * ECNE is on it. It must be marked as UNSENT again so next diff --git a/usrsctplib/netinet6/sctp6_usrreq.c b/usrsctplib/netinet6/sctp6_usrreq.c index 773d389d3..5a931dd5a 100644 --- a/usrsctplib/netinet6/sctp6_usrreq.c +++ b/usrsctplib/netinet6/sctp6_usrreq.c @@ -1703,7 +1703,7 @@ sctp6_usrreq(so, req, m, nam, control, p) switch (family) { case PF_INET: error = in_control(so, (long)m, (caddr_t)nam, - (struct ifnet *)control ); + (struct ifnet *)control); break; #ifdef INET6 case PF_INET6: