aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp
diff options
context:
space:
mode:
authorGerrit Renker <gerrit@erg.abdn.ac.uk>2009-09-12 03:47:01 -0400
committerDavid S. Miller <davem@davemloft.net>2009-09-14 20:02:54 -0400
commitaa1b1ff0991b469eca6fde4456190df6ed59ff40 (patch)
treed2fc84d3e83dd121fd4a48c8560b212123688eb4 /net/dccp
parentd136f1bd366fdb7e747ca7e0218171e7a00a98a5 (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')
-rw-r--r--net/dccp/ccids/Kconfig6
-rw-r--r--net/dccp/ccids/ccid2.c2
-rw-r--r--net/dccp/ccids/ccid2.h8
-rw-r--r--net/dccp/ccids/ccid3.c5
-rw-r--r--net/dccp/ccids/ccid3.h50
-rw-r--r--net/dccp/ccids/lib/loss_interval.c7
-rw-r--r--net/dccp/ccids/lib/loss_interval.h2
-rw-r--r--net/dccp/ccids/lib/packet_history.c4
-rw-r--r--net/dccp/ccids/lib/packet_history.h1
-rw-r--r--net/dccp/ccids/lib/tfrc.h4
-rw-r--r--net/dccp/ccids/lib/tfrc_equation.c26
11 files changed, 48 insertions, 67 deletions
diff --git a/net/dccp/ccids/Kconfig b/net/dccp/ccids/Kconfig
index 4b5db44970aa..8408398cd44e 100644
--- a/net/dccp/ccids/Kconfig
+++ b/net/dccp/ccids/Kconfig
@@ -66,9 +66,9 @@ config IP_DCCP_CCID3_RTO
66 A value of 0 disables this feature by enforcing the value specified 66 A value of 0 disables this feature by enforcing the value specified
67 in RFC 3448. The following values have been suggested as bounds for 67 in RFC 3448. The following values have been suggested as bounds for
68 experimental use: 68 experimental use:
69 * 16-20ms to match the typical multimedia inter-frame interval 69 * 16-20ms to match the typical multimedia inter-frame interval
70 * 100ms as a reasonable compromise [default] 70 * 100ms as a reasonable compromise [default]
71 * 1000ms corresponds to the lower TCP RTO bound (RFC 2988, 2.4) 71 * 1000ms corresponds to the lower TCP RTO bound (RFC 2988, 2.4)
72 72
73 The default of 100ms is a compromise between a large value for 73 The default of 100ms is a compromise between a large value for
74 efficient DCCP implementations, and a small value to avoid disrupting 74 efficient DCCP implementations, and a small value to avoid disrupting
diff --git a/net/dccp/ccids/ccid2.c b/net/dccp/ccids/ccid2.c
index d235294ace23..e8cf99e880b0 100644
--- a/net/dccp/ccids/ccid2.c
+++ b/net/dccp/ccids/ccid2.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * net/dccp/ccids/ccid2.c
3 *
4 * Copyright (c) 2005, 2006 Andrea Bittau <a.bittau@cs.ucl.ac.uk> 2 * Copyright (c) 2005, 2006 Andrea Bittau <a.bittau@cs.ucl.ac.uk>
5 * 3 *
6 * Changes to meet Linux coding standards, and DCCP infrastructure fixes. 4 * Changes to meet Linux coding standards, and DCCP infrastructure fixes.
diff --git a/net/dccp/ccids/ccid2.h b/net/dccp/ccids/ccid2.h
index 2c94ca029010..326ac90fb909 100644
--- a/net/dccp/ccids/ccid2.h
+++ b/net/dccp/ccids/ccid2.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * net/dccp/ccids/ccid2.h
3 *
4 * Copyright (c) 2005 Andrea Bittau <a.bittau@cs.ucl.ac.uk> 2 * Copyright (c) 2005 Andrea Bittau <a.bittau@cs.ucl.ac.uk>
5 * 3 *
6 * This program is free software; you can redistribute it and/or modify 4 * This program is free software; you can redistribute it and/or modify
@@ -40,14 +38,14 @@ struct ccid2_seq {
40#define CCID2_SEQBUF_LEN 1024 38#define CCID2_SEQBUF_LEN 1024
41#define CCID2_SEQBUF_MAX 128 39#define CCID2_SEQBUF_MAX 128
42 40
43/** struct ccid2_hc_tx_sock - CCID2 TX half connection 41/**
44 * 42 * struct ccid2_hc_tx_sock - CCID2 TX half connection
45 * @ccid2hctx_{cwnd,ssthresh,pipe}: as per RFC 4341, section 5 43 * @ccid2hctx_{cwnd,ssthresh,pipe}: as per RFC 4341, section 5
46 * @ccid2hctx_packets_acked - Ack counter for deriving cwnd growth (RFC 3465) 44 * @ccid2hctx_packets_acked - Ack counter for deriving cwnd growth (RFC 3465)
47 * @ccid2hctx_lastrtt -time RTT was last measured 45 * @ccid2hctx_lastrtt -time RTT was last measured
48 * @ccid2hctx_rpseq - last consecutive seqno 46 * @ccid2hctx_rpseq - last consecutive seqno
49 * @ccid2hctx_rpdupack - dupacks since rpseq 47 * @ccid2hctx_rpdupack - dupacks since rpseq
50*/ 48 */
51struct ccid2_hc_tx_sock { 49struct ccid2_hc_tx_sock {
52 u32 ccid2hctx_cwnd; 50 u32 ccid2hctx_cwnd;
53 u32 ccid2hctx_ssthresh; 51 u32 ccid2hctx_ssthresh;
diff --git a/net/dccp/ccids/ccid3.c b/net/dccp/ccids/ccid3.c
index f596ce149c3c..34dcc798c457 100644
--- a/net/dccp/ccids/ccid3.c
+++ b/net/dccp/ccids/ccid3.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * net/dccp/ccids/ccid3.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>
@@ -750,7 +748,8 @@ static int ccid3_hc_rx_insert_options(struct sock *sk, struct sk_buff *skb)
750 return 0; 748 return 0;
751} 749}
752 750
753/** ccid3_first_li - Implements [RFC 3448, 6.3.1] 751/**
752 * ccid3_first_li - Implements [RFC 5348, 6.3.1]
754 * 753 *
755 * Determine the length of the first loss interval via inverse lookup. 754 * Determine the length of the first loss interval via inverse lookup.
756 * Assume that X_recv can be computed by the throughput equation 755 * Assume that X_recv can be computed by the throughput equation
diff --git a/net/dccp/ccids/ccid3.h b/net/dccp/ccids/ccid3.h
index 49ca32bd7e79..e5a244143846 100644
--- a/net/dccp/ccids/ccid3.h
+++ b/net/dccp/ccids/ccid3.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * net/dccp/ccids/ccid3.h
3 *
4 * Copyright (c) 2005-7 The University of Waikato, Hamilton, New Zealand. 2 * Copyright (c) 2005-7 The University of Waikato, Hamilton, New Zealand.
5 * Copyright (c) 2007 The University of Aberdeen, Scotland, UK 3 * Copyright (c) 2007 The University of Aberdeen, Scotland, UK
6 * 4 *
@@ -75,8 +73,8 @@ enum ccid3_hc_tx_states {
75 TFRC_SSTATE_TERM, 73 TFRC_SSTATE_TERM,
76}; 74};
77 75
78/** struct ccid3_hc_tx_sock - CCID3 sender half-connection socket 76/**
79 * 77 * struct ccid3_hc_tx_sock - CCID3 sender half-connection socket
80 * @ccid3hctx_x - Current sending rate in 64 * bytes per second 78 * @ccid3hctx_x - Current sending rate in 64 * bytes per second
81 * @ccid3hctx_x_recv - Receive rate in 64 * bytes per second 79 * @ccid3hctx_x_recv - Receive rate in 64 * bytes per second
82 * @ccid3hctx_x_calc - Calculated rate in bytes per second 80 * @ccid3hctx_x_calc - Calculated rate in bytes per second
@@ -119,9 +117,9 @@ struct ccid3_hc_tx_sock {
119 117
120static inline struct ccid3_hc_tx_sock *ccid3_hc_tx_sk(const struct sock *sk) 118static inline struct ccid3_hc_tx_sock *ccid3_hc_tx_sk(const struct sock *sk)
121{ 119{
122 struct ccid3_hc_tx_sock *hctx = ccid_priv(dccp_sk(sk)->dccps_hc_tx_ccid); 120 struct ccid3_hc_tx_sock *hctx = ccid_priv(dccp_sk(sk)->dccps_hc_tx_ccid);
123 BUG_ON(hctx == NULL); 121 BUG_ON(hctx == NULL);
124 return hctx; 122 return hctx;
125} 123}
126 124
127/* TFRC receiver states */ 125/* TFRC receiver states */
@@ -131,22 +129,22 @@ enum ccid3_hc_rx_states {
131 TFRC_RSTATE_TERM = 127, 129 TFRC_RSTATE_TERM = 127,
132}; 130};
133 131
134/** struct ccid3_hc_rx_sock - CCID3 receiver half-connection socket 132/**
135 * 133 * struct ccid3_hc_rx_sock - CCID3 receiver half-connection socket
136 * @ccid3hcrx_x_recv - Receiver estimate of send rate (RFC 3448 4.3) 134 * @ccid3hcrx_x_recv - Receiver estimate of send rate (RFC 3448 4.3)
137 * @ccid3hcrx_rtt - Receiver estimate of rtt (non-standard) 135 * @ccid3hcrx_rtt - Receiver estimate of rtt (non-standard)
138 * @ccid3hcrx_p - Current loss event rate (RFC 3448 5.4) 136 * @ccid3hcrx_p - Current loss event rate (RFC 3448 5.4)
139 * @ccid3hcrx_last_counter - Tracks window counter (RFC 4342, 8.1) 137 * @ccid3hcrx_last_counter - Tracks window counter (RFC 4342, 8.1)
140 * @ccid3hcrx_state - Receiver state, one of %ccid3_hc_rx_states 138 * @ccid3hcrx_state - Receiver state, one of %ccid3_hc_rx_states
141 * @ccid3hcrx_bytes_recv - Total sum of DCCP payload bytes 139 * @ccid3hcrx_bytes_recv - Total sum of DCCP payload bytes
142 * @ccid3hcrx_x_recv - Receiver estimate of send rate (RFC 3448, sec. 4.3) 140 * @ccid3hcrx_x_recv - Receiver estimate of send rate (RFC 3448, sec. 4.3)
143 * @ccid3hcrx_rtt - Receiver estimate of RTT 141 * @ccid3hcrx_rtt - Receiver estimate of RTT
144 * @ccid3hcrx_tstamp_last_feedback - Time at which last feedback was sent 142 * @ccid3hcrx_tstamp_last_feedback - Time at which last feedback was sent
145 * @ccid3hcrx_tstamp_last_ack - Time at which last feedback was sent 143 * @ccid3hcrx_tstamp_last_ack - Time at which last feedback was sent
146 * @ccid3hcrx_hist - Packet history (loss detection + RTT sampling) 144 * @ccid3hcrx_hist - Packet history (loss detection + RTT sampling)
147 * @ccid3hcrx_li_hist - Loss Interval database 145 * @ccid3hcrx_li_hist - Loss Interval database
148 * @ccid3hcrx_s - Received packet size in bytes 146 * @ccid3hcrx_s - Received packet size in bytes
149 * @ccid3hcrx_pinv - Inverse of Loss Event Rate (RFC 4342, sec. 8.5) 147 * @ccid3hcrx_pinv - Inverse of Loss Event Rate (RFC 4342, sec. 8.5)
150 */ 148 */
151struct ccid3_hc_rx_sock { 149struct ccid3_hc_rx_sock {
152 u8 ccid3hcrx_last_counter:4; 150 u8 ccid3hcrx_last_counter:4;
@@ -163,9 +161,9 @@ struct ccid3_hc_rx_sock {
163 161
164static inline struct ccid3_hc_rx_sock *ccid3_hc_rx_sk(const struct sock *sk) 162static inline struct ccid3_hc_rx_sock *ccid3_hc_rx_sk(const struct sock *sk)
165{ 163{
166 struct ccid3_hc_rx_sock *hcrx = ccid_priv(dccp_sk(sk)->dccps_hc_rx_ccid); 164 struct ccid3_hc_rx_sock *hcrx = ccid_priv(dccp_sk(sk)->dccps_hc_rx_ccid);
167 BUG_ON(hcrx == NULL); 165 BUG_ON(hcrx == NULL);
168 return hcrx; 166 return hcrx;
169} 167}
170 168
171#endif /* _DCCP_CCID3_H_ */ 169#endif /* _DCCP_CCID3_H_ */
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 */
22static inline u8 LIH_INDEX(const u8 ctr) 20static 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 */
133static struct kmem_cache *tfrc_rx_hist_slab; 131static 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 */
33static inline u64 scaled_div(u64 a, u64 b) 31static 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 */
619u32 tfrc_calc_x(u16 s, u32 R, u32 p) 616u32 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 */