aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp/ccids/ccid2.c
diff options
context:
space:
mode:
authorGerrit Renker <gerrit@erg.abdn.ac.uk>2007-10-04 14:41:55 -0700
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 16:54:34 -0700
commitee196c2186d24d82088c94962598470e5abc081f (patch)
tree18d6f4382ae847c9e6091de8f766eb2918f11a99 /net/dccp/ccids/ccid2.c
parent7d9e8931f93683e575679e41f188d3b465269f08 (diff)
downloadkernel_samsung_smdk4412-ee196c2186d24d82088c94962598470e5abc081f.zip
kernel_samsung_smdk4412-ee196c2186d24d82088c94962598470e5abc081f.tar.gz
kernel_samsung_smdk4412-ee196c2186d24d82088c94962598470e5abc081f.tar.bz2
[CCID2]: Remove redundant BUG_ON
This removes a test for `val < 1' which would only have been triggered when val < 0, due to a preceding test for 0. Fixed by using an unsigned type for cwnd (as in TCP) instead. Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dccp/ccids/ccid2.c')
-rw-r--r--net/dccp/ccids/ccid2.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/net/dccp/ccids/ccid2.c b/net/dccp/ccids/ccid2.c
index 3e4fa6b..5114a2d 100644
--- a/net/dccp/ccids/ccid2.c
+++ b/net/dccp/ccids/ccid2.c
@@ -179,16 +179,11 @@ static void ccid2_change_l_ack_ratio(struct sock *sk, int val)
dp->dccps_l_ack_ratio = val;
}
-static void ccid2_change_cwnd(struct ccid2_hc_tx_sock *hctx, int val)
+static void ccid2_change_cwnd(struct ccid2_hc_tx_sock *hctx, u32 val)
{
- if (val == 0)
- val = 1;
-
/* XXX do we need to change ack ratio? */
- ccid2_pr_debug("change cwnd to %d\n", val);
-
- BUG_ON(val < 1);
- hctx->ccid2hctx_cwnd = val;
+ hctx->ccid2hctx_cwnd = val? : 1;
+ ccid2_pr_debug("changed cwnd to %u\n", hctx->ccid2hctx_cwnd);
}
static void ccid2_change_srtt(struct ccid2_hc_tx_sock *hctx, long val)