Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net-next-2.6 [PATCH 1/1] dccp: ccids whitespace-cleanup / CodingStyle

No code change, cosmetical changes only:

* whitespace cleanup via scripts/cleanfile,
* remove self-references to filename at top of files,
* fix coding style (extraneous brackets),
* fix documentation style (kernel-doc-nano-HOWTO).

Thanks are due to Ivo Augusto Calado who raised these issues by
submitting good-quality patches.

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Gerrit Renker and committed by
David S. Miller
aa1b1ff0 d136f1bd

+48 -67
+3 -3
net/dccp/ccids/Kconfig
··· 66 66 A value of 0 disables this feature by enforcing the value specified 67 67 in RFC 3448. The following values have been suggested as bounds for 68 68 experimental use: 69 - * 16-20ms to match the typical multimedia inter-frame interval 70 - * 100ms as a reasonable compromise [default] 71 - * 1000ms corresponds to the lower TCP RTO bound (RFC 2988, 2.4) 69 + * 16-20ms to match the typical multimedia inter-frame interval 70 + * 100ms as a reasonable compromise [default] 71 + * 1000ms corresponds to the lower TCP RTO bound (RFC 2988, 2.4) 72 72 73 73 The default of 100ms is a compromise between a large value for 74 74 efficient DCCP implementations, and a small value to avoid disrupting
-2
net/dccp/ccids/ccid2.c
··· 1 1 /* 2 - * net/dccp/ccids/ccid2.c 3 - * 4 2 * Copyright (c) 2005, 2006 Andrea Bittau <a.bittau@cs.ucl.ac.uk> 5 3 * 6 4 * Changes to meet Linux coding standards, and DCCP infrastructure fixes.
+3 -5
net/dccp/ccids/ccid2.h
··· 1 1 /* 2 - * net/dccp/ccids/ccid2.h 3 - * 4 2 * Copyright (c) 2005 Andrea Bittau <a.bittau@cs.ucl.ac.uk> 5 3 * 6 4 * This program is free software; you can redistribute it and/or modify ··· 38 40 #define CCID2_SEQBUF_LEN 1024 39 41 #define CCID2_SEQBUF_MAX 128 40 42 41 - /** struct ccid2_hc_tx_sock - CCID2 TX half connection 42 - * 43 + /** 44 + * struct ccid2_hc_tx_sock - CCID2 TX half connection 43 45 * @ccid2hctx_{cwnd,ssthresh,pipe}: as per RFC 4341, section 5 44 46 * @ccid2hctx_packets_acked - Ack counter for deriving cwnd growth (RFC 3465) 45 47 * @ccid2hctx_lastrtt -time RTT was last measured 46 48 * @ccid2hctx_rpseq - last consecutive seqno 47 49 * @ccid2hctx_rpdupack - dupacks since rpseq 48 - */ 50 + */ 49 51 struct ccid2_hc_tx_sock { 50 52 u32 ccid2hctx_cwnd; 51 53 u32 ccid2hctx_ssthresh;
+2 -3
net/dccp/ccids/ccid3.c
··· 1 1 /* 2 - * net/dccp/ccids/ccid3.c 3 - * 4 2 * Copyright (c) 2007 The University of Aberdeen, Scotland, UK 5 3 * Copyright (c) 2005-7 The University of Waikato, Hamilton, New Zealand. 6 4 * Copyright (c) 2005-7 Ian McDonald <ian.mcdonald@jandi.co.nz> ··· 748 750 return 0; 749 751 } 750 752 751 - /** ccid3_first_li - Implements [RFC 3448, 6.3.1] 753 + /** 754 + * ccid3_first_li - Implements [RFC 5348, 6.3.1] 752 755 * 753 756 * Determine the length of the first loss interval via inverse lookup. 754 757 * Assume that X_recv can be computed by the throughput equation
+24 -26
net/dccp/ccids/ccid3.h
··· 1 1 /* 2 - * net/dccp/ccids/ccid3.h 3 - * 4 2 * Copyright (c) 2005-7 The University of Waikato, Hamilton, New Zealand. 5 3 * Copyright (c) 2007 The University of Aberdeen, Scotland, UK 6 4 * ··· 73 75 TFRC_SSTATE_TERM, 74 76 }; 75 77 76 - /** struct ccid3_hc_tx_sock - CCID3 sender half-connection socket 77 - * 78 + /** 79 + * struct ccid3_hc_tx_sock - CCID3 sender half-connection socket 78 80 * @ccid3hctx_x - Current sending rate in 64 * bytes per second 79 81 * @ccid3hctx_x_recv - Receive rate in 64 * bytes per second 80 82 * @ccid3hctx_x_calc - Calculated rate in bytes per second ··· 117 119 118 120 static inline struct ccid3_hc_tx_sock *ccid3_hc_tx_sk(const struct sock *sk) 119 121 { 120 - struct ccid3_hc_tx_sock *hctx = ccid_priv(dccp_sk(sk)->dccps_hc_tx_ccid); 121 - BUG_ON(hctx == NULL); 122 - return hctx; 122 + struct ccid3_hc_tx_sock *hctx = ccid_priv(dccp_sk(sk)->dccps_hc_tx_ccid); 123 + BUG_ON(hctx == NULL); 124 + return hctx; 123 125 } 124 126 125 127 /* TFRC receiver states */ ··· 129 131 TFRC_RSTATE_TERM = 127, 130 132 }; 131 133 132 - /** struct ccid3_hc_rx_sock - CCID3 receiver half-connection socket 133 - * 134 - * @ccid3hcrx_x_recv - Receiver estimate of send rate (RFC 3448 4.3) 135 - * @ccid3hcrx_rtt - Receiver estimate of rtt (non-standard) 136 - * @ccid3hcrx_p - Current loss event rate (RFC 3448 5.4) 137 - * @ccid3hcrx_last_counter - Tracks window counter (RFC 4342, 8.1) 138 - * @ccid3hcrx_state - Receiver state, one of %ccid3_hc_rx_states 139 - * @ccid3hcrx_bytes_recv - Total sum of DCCP payload bytes 140 - * @ccid3hcrx_x_recv - Receiver estimate of send rate (RFC 3448, sec. 4.3) 141 - * @ccid3hcrx_rtt - Receiver estimate of RTT 142 - * @ccid3hcrx_tstamp_last_feedback - Time at which last feedback was sent 143 - * @ccid3hcrx_tstamp_last_ack - Time at which last feedback was sent 144 - * @ccid3hcrx_hist - Packet history (loss detection + RTT sampling) 145 - * @ccid3hcrx_li_hist - Loss Interval database 146 - * @ccid3hcrx_s - Received packet size in bytes 147 - * @ccid3hcrx_pinv - Inverse of Loss Event Rate (RFC 4342, sec. 8.5) 134 + /** 135 + * struct ccid3_hc_rx_sock - CCID3 receiver half-connection socket 136 + * @ccid3hcrx_x_recv - Receiver estimate of send rate (RFC 3448 4.3) 137 + * @ccid3hcrx_rtt - Receiver estimate of rtt (non-standard) 138 + * @ccid3hcrx_p - Current loss event rate (RFC 3448 5.4) 139 + * @ccid3hcrx_last_counter - Tracks window counter (RFC 4342, 8.1) 140 + * @ccid3hcrx_state - Receiver state, one of %ccid3_hc_rx_states 141 + * @ccid3hcrx_bytes_recv - Total sum of DCCP payload bytes 142 + * @ccid3hcrx_x_recv - Receiver estimate of send rate (RFC 3448, sec. 4.3) 143 + * @ccid3hcrx_rtt - Receiver estimate of RTT 144 + * @ccid3hcrx_tstamp_last_feedback - Time at which last feedback was sent 145 + * @ccid3hcrx_tstamp_last_ack - Time at which last feedback was sent 146 + * @ccid3hcrx_hist - Packet history (loss detection + RTT sampling) 147 + * @ccid3hcrx_li_hist - Loss Interval database 148 + * @ccid3hcrx_s - Received packet size in bytes 149 + * @ccid3hcrx_pinv - Inverse of Loss Event Rate (RFC 4342, sec. 8.5) 148 150 */ 149 151 struct ccid3_hc_rx_sock { 150 152 u8 ccid3hcrx_last_counter:4; ··· 161 163 162 164 static inline struct ccid3_hc_rx_sock *ccid3_hc_rx_sk(const struct sock *sk) 163 165 { 164 - struct ccid3_hc_rx_sock *hcrx = ccid_priv(dccp_sk(sk)->dccps_hc_rx_ccid); 165 - BUG_ON(hcrx == NULL); 166 - return hcrx; 166 + struct ccid3_hc_rx_sock *hcrx = ccid_priv(dccp_sk(sk)->dccps_hc_rx_ccid); 167 + BUG_ON(hcrx == NULL); 168 + return hcrx; 167 169 } 168 170 169 171 #endif /* _DCCP_CCID3_H_ */
+3 -4
net/dccp/ccids/lib/loss_interval.c
··· 1 1 /* 2 - * net/dccp/ccids/lib/loss_interval.c 3 - * 4 2 * Copyright (c) 2007 The University of Aberdeen, Scotland, UK 5 3 * Copyright (c) 2005-7 The University of Waikato, Hamilton, New Zealand. 6 4 * Copyright (c) 2005-7 Ian McDonald <ian.mcdonald@jandi.co.nz> ··· 19 21 /* implements LIFO semantics on the array */ 20 22 static inline u8 LIH_INDEX(const u8 ctr) 21 23 { 22 - return (LIH_SIZE - 1 - (ctr % LIH_SIZE)); 24 + return LIH_SIZE - 1 - (ctr % LIH_SIZE); 23 25 } 24 26 25 27 /* the `counter' index always points at the next entry to be populated */ ··· 127 129 (cur->li_is_closed || SUB16(new_loss->tfrchrx_ccval, cur->li_ccval) > 4); 128 130 } 129 131 130 - /** tfrc_lh_interval_add - Insert new record into the Loss Interval database 132 + /** 133 + * tfrc_lh_interval_add - Insert new record into the Loss Interval database 131 134 * @lh: Loss Interval database 132 135 * @rh: Receive history containing a fresh loss event 133 136 * @calc_first_li: Caller-dependent routine to compute length of first interval
-2
net/dccp/ccids/lib/loss_interval.h
··· 1 1 #ifndef _DCCP_LI_HIST_ 2 2 #define _DCCP_LI_HIST_ 3 3 /* 4 - * net/dccp/ccids/lib/loss_interval.h 5 - * 6 4 * Copyright (c) 2007 The University of Aberdeen, Scotland, UK 7 5 * Copyright (c) 2005-7 The University of Waikato, Hamilton, New Zealand. 8 6 * Copyright (c) 2005-7 Ian McDonald <ian.mcdonald@jandi.co.nz>
+1 -3
net/dccp/ccids/lib/packet_history.c
··· 1 1 /* 2 - * net/dccp/packet_history.c 3 - * 4 2 * Copyright (c) 2007 The University of Aberdeen, Scotland, UK 5 3 * Copyright (c) 2005-7 The University of Waikato, Hamilton, New Zealand. 6 4 * ··· 126 128 127 129 128 130 /* 129 - * Receiver History Routines 131 + * Receiver History Routines 130 132 */ 131 133 static struct kmem_cache *tfrc_rx_hist_slab; 132 134
-1
net/dccp/ccids/lib/packet_history.h
··· 70 70 71 71 /** 72 72 * tfrc_rx_hist - RX history structure for TFRC-based protocols 73 - * 74 73 * @ring: Packet history for RTT sampling and loss detection 75 74 * @loss_count: Number of entries in circular history 76 75 * @loss_start: Movable index (for loss detection)
+1 -3
net/dccp/ccids/lib/tfrc.h
··· 1 1 #ifndef _TFRC_H_ 2 2 #define _TFRC_H_ 3 3 /* 4 - * net/dccp/ccids/lib/tfrc.h 5 - * 6 4 * Copyright (c) 2007 The University of Aberdeen, Scotland, UK 7 5 * Copyright (c) 2005-6 The University of Waikato, Hamilton, New Zealand. 8 6 * Copyright (c) 2005-6 Ian McDonald <ian.mcdonald@jandi.co.nz> ··· 30 32 /* integer-arithmetic divisions of type (a * 1000000)/b */ 31 33 static inline u64 scaled_div(u64 a, u64 b) 32 34 { 33 - BUG_ON(b==0); 35 + BUG_ON(b == 0); 34 36 return div64_u64(a * 1000000, b); 35 37 } 36 38
+11 -15
net/dccp/ccids/lib/tfrc_equation.c
··· 1 1 /* 2 - * net/dccp/ccids/lib/tfrc_equation.c 3 - * 4 2 * Copyright (c) 2005 The University of Waikato, Hamilton, New Zealand. 5 3 * Copyright (c) 2005 Ian McDonald <ian.mcdonald@jandi.co.nz> 6 4 * Copyright (c) 2005 Arnaldo Carvalho de Melo <acme@conectiva.com.br> ··· 77 79 } 78 80 79 81 With the given configuration, we have, with M = TFRC_CALC_X_ARRSIZE-1, 80 - lookup[0][0] = g(1000000/(M+1)) = 1000000 * f(0.2%) 81 - lookup[M][0] = g(1000000) = 1000000 * f(100%) 82 - lookup[0][1] = g(TFRC_SMALLEST_P) = 1000000 * f(0.01%) 83 - lookup[M][1] = g(TFRC_CALC_X_SPLIT) = 1000000 * f(5%) 82 + lookup[0][0] = g(1000000/(M+1)) = 1000000 * f(0.2%) 83 + lookup[M][0] = g(1000000) = 1000000 * f(100%) 84 + lookup[0][1] = g(TFRC_SMALLEST_P) = 1000000 * f(0.01%) 85 + lookup[M][1] = g(TFRC_CALC_X_SPLIT) = 1000000 * f(5%) 84 86 85 87 In summary, the two columns represent f(p) for the following ranges: 86 88 * The first column is for 0.002 <= p <= 1.0 ··· 608 610 609 611 /** 610 612 * tfrc_calc_x - Calculate the send rate as per section 3.1 of RFC3448 611 - * 612 - * @s: packet size in bytes 613 - * @R: RTT scaled by 1000000 (i.e., microseconds) 614 - * @p: loss ratio estimate scaled by 1000000 615 - * Returns X_calc in bytes per second (not scaled). 613 + * @s: packet size in bytes 614 + * @R: RTT scaled by 1000000 (i.e., microseconds) 615 + * @p: loss ratio estimate scaled by 1000000 616 + * Returns X_calc in bytes per second (not scaled). 616 617 */ 617 618 u32 tfrc_calc_x(u16 s, u32 R, u32 p) 618 619 { ··· 627 630 return ~0U; 628 631 } 629 632 630 - if (p <= TFRC_CALC_X_SPLIT) { /* 0.0000 < p <= 0.05 */ 633 + if (p <= TFRC_CALC_X_SPLIT) { /* 0.0000 < p <= 0.05 */ 631 634 if (p < TFRC_SMALLEST_P) { /* 0.0000 < p < 0.0001 */ 632 635 DCCP_WARN("Value of p (%d) below resolution. " 633 636 "Substituting %d\n", p, TFRC_SMALLEST_P); 634 637 index = 0; 635 - } else /* 0.0001 <= p <= 0.05 */ 638 + } else /* 0.0001 <= p <= 0.05 */ 636 639 index = p/TFRC_SMALLEST_P - 1; 637 640 638 641 f = tfrc_calc_x_lookup[index][1]; 639 642 640 - } else { /* 0.05 < p <= 1.00 */ 643 + } else { /* 0.05 < p <= 1.00 */ 641 644 index = p/(1000000/TFRC_CALC_X_ARRSIZE) - 1; 642 645 643 646 f = tfrc_calc_x_lookup[index][0]; ··· 658 661 659 662 /** 660 663 * tfrc_calc_x_reverse_lookup - try to find p given f(p) 661 - * 662 664 * @fvalue: function value to match, scaled by 1000000 663 665 * Returns closest match for p, also scaled by 1000000 664 666 */