diff options
author | Gerrit Renker <gerrit@erg.abdn.ac.uk> | 2009-09-12 03:47:01 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-09-14 20:02:54 -0400 |
commit | aa1b1ff0991b469eca6fde4456190df6ed59ff40 (patch) | |
tree | d2fc84d3e83dd121fd4a48c8560b212123688eb4 /net/dccp/ccids/lib | |
parent | d136f1bd366fdb7e747ca7e0218171e7a00a98a5 (diff) |
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>
Diffstat (limited to 'net/dccp/ccids/lib')
-rw-r--r-- | net/dccp/ccids/lib/loss_interval.c | 7 | ||||
-rw-r--r-- | net/dccp/ccids/lib/loss_interval.h | 2 | ||||
-rw-r--r-- | net/dccp/ccids/lib/packet_history.c | 4 | ||||
-rw-r--r-- | net/dccp/ccids/lib/packet_history.h | 1 | ||||
-rw-r--r-- | net/dccp/ccids/lib/tfrc.h | 4 | ||||
-rw-r--r-- | net/dccp/ccids/lib/tfrc_equation.c | 26 |
6 files changed, 16 insertions, 28 deletions
diff --git a/net/dccp/ccids/lib/loss_interval.c b/net/dccp/ccids/lib/loss_interval.c index 4d1e40127264..8fc3cbf79071 100644 --- a/net/dccp/ccids/lib/loss_interval.c +++ b/net/dccp/ccids/lib/loss_interval.c | |||
@@ -1,6 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * net/dccp/ccids/lib/loss_interval.c | ||
3 | * | ||
4 | * Copyright (c) 2007 The University of Aberdeen, Scotland, UK | 2 | * Copyright (c) 2007 The University of Aberdeen, Scotland, UK |
5 | * Copyright (c) 2005-7 The University of Waikato, Hamilton, New Zealand. | 3 | * Copyright (c) 2005-7 The University of Waikato, Hamilton, New Zealand. |
6 | * Copyright (c) 2005-7 Ian McDonald <ian.mcdonald@jandi.co.nz> | 4 | * Copyright (c) 2005-7 Ian McDonald <ian.mcdonald@jandi.co.nz> |
@@ -21,7 +19,7 @@ static const int tfrc_lh_weights[NINTERVAL] = { 10, 10, 10, 10, 8, 6, 4, 2 }; | |||
21 | /* implements LIFO semantics on the array */ | 19 | /* implements LIFO semantics on the array */ |
22 | static inline u8 LIH_INDEX(const u8 ctr) | 20 | static inline u8 LIH_INDEX(const u8 ctr) |
23 | { | 21 | { |
24 | return (LIH_SIZE - 1 - (ctr % LIH_SIZE)); | 22 | return LIH_SIZE - 1 - (ctr % LIH_SIZE); |
25 | } | 23 | } |
26 | 24 | ||
27 | /* the `counter' index always points at the next entry to be populated */ | 25 | /* the `counter' index always points at the next entry to be populated */ |
@@ -129,7 +127,8 @@ static inline u8 tfrc_lh_is_new_loss(struct tfrc_loss_interval *cur, | |||
129 | (cur->li_is_closed || SUB16(new_loss->tfrchrx_ccval, cur->li_ccval) > 4); | 127 | (cur->li_is_closed || SUB16(new_loss->tfrchrx_ccval, cur->li_ccval) > 4); |
130 | } | 128 | } |
131 | 129 | ||
132 | /** tfrc_lh_interval_add - Insert new record into the Loss Interval database | 130 | /** |
131 | * tfrc_lh_interval_add - Insert new record into the Loss Interval database | ||
133 | * @lh: Loss Interval database | 132 | * @lh: Loss Interval database |
134 | * @rh: Receive history containing a fresh loss event | 133 | * @rh: Receive history containing a fresh loss event |
135 | * @calc_first_li: Caller-dependent routine to compute length of first interval | 134 | * @calc_first_li: Caller-dependent routine to compute length of first interval |
diff --git a/net/dccp/ccids/lib/loss_interval.h b/net/dccp/ccids/lib/loss_interval.h index 246018a3b269..d1d2f5383b7d 100644 --- a/net/dccp/ccids/lib/loss_interval.h +++ b/net/dccp/ccids/lib/loss_interval.h | |||
@@ -1,8 +1,6 @@ | |||
1 | #ifndef _DCCP_LI_HIST_ | 1 | #ifndef _DCCP_LI_HIST_ |
2 | #define _DCCP_LI_HIST_ | 2 | #define _DCCP_LI_HIST_ |
3 | /* | 3 | /* |
4 | * net/dccp/ccids/lib/loss_interval.h | ||
5 | * | ||
6 | * Copyright (c) 2007 The University of Aberdeen, Scotland, UK | 4 | * Copyright (c) 2007 The University of Aberdeen, Scotland, UK |
7 | * Copyright (c) 2005-7 The University of Waikato, Hamilton, New Zealand. | 5 | * Copyright (c) 2005-7 The University of Waikato, Hamilton, New Zealand. |
8 | * Copyright (c) 2005-7 Ian McDonald <ian.mcdonald@jandi.co.nz> | 6 | * Copyright (c) 2005-7 Ian McDonald <ian.mcdonald@jandi.co.nz> |
diff --git a/net/dccp/ccids/lib/packet_history.c b/net/dccp/ccids/lib/packet_history.c index b7785b3581ec..3a4f414e94a0 100644 --- a/net/dccp/ccids/lib/packet_history.c +++ b/net/dccp/ccids/lib/packet_history.c | |||
@@ -1,6 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * net/dccp/packet_history.c | ||
3 | * | ||
4 | * Copyright (c) 2007 The University of Aberdeen, Scotland, UK | 2 | * Copyright (c) 2007 The University of Aberdeen, Scotland, UK |
5 | * Copyright (c) 2005-7 The University of Waikato, Hamilton, New Zealand. | 3 | * Copyright (c) 2005-7 The University of Waikato, Hamilton, New Zealand. |
6 | * | 4 | * |
@@ -128,7 +126,7 @@ u32 tfrc_tx_hist_rtt(struct tfrc_tx_hist_entry *head, const u64 seqno, | |||
128 | 126 | ||
129 | 127 | ||
130 | /* | 128 | /* |
131 | * Receiver History Routines | 129 | * Receiver History Routines |
132 | */ | 130 | */ |
133 | static struct kmem_cache *tfrc_rx_hist_slab; | 131 | static struct kmem_cache *tfrc_rx_hist_slab; |
134 | 132 | ||
diff --git a/net/dccp/ccids/lib/packet_history.h b/net/dccp/ccids/lib/packet_history.h index 461cc91cce88..7df6c5299999 100644 --- a/net/dccp/ccids/lib/packet_history.h +++ b/net/dccp/ccids/lib/packet_history.h | |||
@@ -70,7 +70,6 @@ struct tfrc_rx_hist_entry { | |||
70 | 70 | ||
71 | /** | 71 | /** |
72 | * tfrc_rx_hist - RX history structure for TFRC-based protocols | 72 | * tfrc_rx_hist - RX history structure for TFRC-based protocols |
73 | * | ||
74 | * @ring: Packet history for RTT sampling and loss detection | 73 | * @ring: Packet history for RTT sampling and loss detection |
75 | * @loss_count: Number of entries in circular history | 74 | * @loss_count: Number of entries in circular history |
76 | * @loss_start: Movable index (for loss detection) | 75 | * @loss_start: Movable index (for loss detection) |
diff --git a/net/dccp/ccids/lib/tfrc.h b/net/dccp/ccids/lib/tfrc.h index e9720b143275..01bb48e96c2e 100644 --- a/net/dccp/ccids/lib/tfrc.h +++ b/net/dccp/ccids/lib/tfrc.h | |||
@@ -1,8 +1,6 @@ | |||
1 | #ifndef _TFRC_H_ | 1 | #ifndef _TFRC_H_ |
2 | #define _TFRC_H_ | 2 | #define _TFRC_H_ |
3 | /* | 3 | /* |
4 | * net/dccp/ccids/lib/tfrc.h | ||
5 | * | ||
6 | * Copyright (c) 2007 The University of Aberdeen, Scotland, UK | 4 | * Copyright (c) 2007 The University of Aberdeen, Scotland, UK |
7 | * Copyright (c) 2005-6 The University of Waikato, Hamilton, New Zealand. | 5 | * Copyright (c) 2005-6 The University of Waikato, Hamilton, New Zealand. |
8 | * Copyright (c) 2005-6 Ian McDonald <ian.mcdonald@jandi.co.nz> | 6 | * Copyright (c) 2005-6 Ian McDonald <ian.mcdonald@jandi.co.nz> |
@@ -32,7 +30,7 @@ extern int tfrc_debug; | |||
32 | /* integer-arithmetic divisions of type (a * 1000000)/b */ | 30 | /* integer-arithmetic divisions of type (a * 1000000)/b */ |
33 | static inline u64 scaled_div(u64 a, u64 b) | 31 | static inline u64 scaled_div(u64 a, u64 b) |
34 | { | 32 | { |
35 | BUG_ON(b==0); | 33 | BUG_ON(b == 0); |
36 | return div64_u64(a * 1000000, b); | 34 | return div64_u64(a * 1000000, b); |
37 | } | 35 | } |
38 | 36 | ||
diff --git a/net/dccp/ccids/lib/tfrc_equation.c b/net/dccp/ccids/lib/tfrc_equation.c index c5d3a9e5a5a4..22ca1cf0eb55 100644 --- a/net/dccp/ccids/lib/tfrc_equation.c +++ b/net/dccp/ccids/lib/tfrc_equation.c | |||
@@ -1,6 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * net/dccp/ccids/lib/tfrc_equation.c | ||
3 | * | ||
4 | * Copyright (c) 2005 The University of Waikato, Hamilton, New Zealand. | 2 | * Copyright (c) 2005 The University of Waikato, Hamilton, New Zealand. |
5 | * Copyright (c) 2005 Ian McDonald <ian.mcdonald@jandi.co.nz> | 3 | * Copyright (c) 2005 Ian McDonald <ian.mcdonald@jandi.co.nz> |
6 | * Copyright (c) 2005 Arnaldo Carvalho de Melo <acme@conectiva.com.br> | 4 | * Copyright (c) 2005 Arnaldo Carvalho de Melo <acme@conectiva.com.br> |
@@ -79,10 +77,10 @@ | |||
79 | } | 77 | } |
80 | 78 | ||
81 | With the given configuration, we have, with M = TFRC_CALC_X_ARRSIZE-1, | 79 | With the given configuration, we have, with M = TFRC_CALC_X_ARRSIZE-1, |
82 | lookup[0][0] = g(1000000/(M+1)) = 1000000 * f(0.2%) | 80 | lookup[0][0] = g(1000000/(M+1)) = 1000000 * f(0.2%) |
83 | lookup[M][0] = g(1000000) = 1000000 * f(100%) | 81 | lookup[M][0] = g(1000000) = 1000000 * f(100%) |
84 | lookup[0][1] = g(TFRC_SMALLEST_P) = 1000000 * f(0.01%) | 82 | lookup[0][1] = g(TFRC_SMALLEST_P) = 1000000 * f(0.01%) |
85 | lookup[M][1] = g(TFRC_CALC_X_SPLIT) = 1000000 * f(5%) | 83 | lookup[M][1] = g(TFRC_CALC_X_SPLIT) = 1000000 * f(5%) |
86 | 84 | ||
87 | In summary, the two columns represent f(p) for the following ranges: | 85 | In summary, the two columns represent f(p) for the following ranges: |
88 | * The first column is for 0.002 <= p <= 1.0 | 86 | * The first column is for 0.002 <= p <= 1.0 |
@@ -610,11 +608,10 @@ static inline u32 tfrc_binsearch(u32 fval, u8 small) | |||
610 | 608 | ||
611 | /** | 609 | /** |
612 | * tfrc_calc_x - Calculate the send rate as per section 3.1 of RFC3448 | 610 | * tfrc_calc_x - Calculate the send rate as per section 3.1 of RFC3448 |
613 | * | 611 | * @s: packet size in bytes |
614 | * @s: packet size in bytes | 612 | * @R: RTT scaled by 1000000 (i.e., microseconds) |
615 | * @R: RTT scaled by 1000000 (i.e., microseconds) | 613 | * @p: loss ratio estimate scaled by 1000000 |
616 | * @p: loss ratio estimate scaled by 1000000 | 614 | * Returns X_calc in bytes per second (not scaled). |
617 | * Returns X_calc in bytes per second (not scaled). | ||
618 | */ | 615 | */ |
619 | u32 tfrc_calc_x(u16 s, u32 R, u32 p) | 616 | u32 tfrc_calc_x(u16 s, u32 R, u32 p) |
620 | { | 617 | { |
@@ -630,17 +627,17 @@ u32 tfrc_calc_x(u16 s, u32 R, u32 p) | |||
630 | return ~0U; | 627 | return ~0U; |
631 | } | 628 | } |
632 | 629 | ||
633 | if (p <= TFRC_CALC_X_SPLIT) { /* 0.0000 < p <= 0.05 */ | 630 | if (p <= TFRC_CALC_X_SPLIT) { /* 0.0000 < p <= 0.05 */ |
634 | if (p < TFRC_SMALLEST_P) { /* 0.0000 < p < 0.0001 */ | 631 | if (p < TFRC_SMALLEST_P) { /* 0.0000 < p < 0.0001 */ |
635 | DCCP_WARN("Value of p (%d) below resolution. " | 632 | DCCP_WARN("Value of p (%d) below resolution. " |
636 | "Substituting %d\n", p, TFRC_SMALLEST_P); | 633 | "Substituting %d\n", p, TFRC_SMALLEST_P); |
637 | index = 0; | 634 | index = 0; |
638 | } else /* 0.0001 <= p <= 0.05 */ | 635 | } else /* 0.0001 <= p <= 0.05 */ |
639 | index = p/TFRC_SMALLEST_P - 1; | 636 | index = p/TFRC_SMALLEST_P - 1; |
640 | 637 | ||
641 | f = tfrc_calc_x_lookup[index][1]; | 638 | f = tfrc_calc_x_lookup[index][1]; |
642 | 639 | ||
643 | } else { /* 0.05 < p <= 1.00 */ | 640 | } else { /* 0.05 < p <= 1.00 */ |
644 | index = p/(1000000/TFRC_CALC_X_ARRSIZE) - 1; | 641 | index = p/(1000000/TFRC_CALC_X_ARRSIZE) - 1; |
645 | 642 | ||
646 | f = tfrc_calc_x_lookup[index][0]; | 643 | f = tfrc_calc_x_lookup[index][0]; |
@@ -661,7 +658,6 @@ u32 tfrc_calc_x(u16 s, u32 R, u32 p) | |||
661 | 658 | ||
662 | /** | 659 | /** |
663 | * tfrc_calc_x_reverse_lookup - try to find p given f(p) | 660 | * tfrc_calc_x_reverse_lookup - try to find p given f(p) |
664 | * | ||
665 | * @fvalue: function value to match, scaled by 1000000 | 661 | * @fvalue: function value to match, scaled by 1000000 |
666 | * Returns closest match for p, also scaled by 1000000 | 662 | * Returns closest match for p, also scaled by 1000000 |
667 | */ | 663 | */ |