htcp: merge icsk_ca_state compare
authorIlpo Järvinen <ilpo.jarvinen@helsinki.fi>
Sat, 28 Feb 2009 04:44:36 +0000 (04:44 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 2 Mar 2009 11:00:14 +0000 (03:00 -0800)
Similar to what is done elsewhere in TCP code when double
state checks are being done.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp_htcp.c

index 937549b8a9212fa6289964bde303367e2f462d74..26d5c7fc7de51139c28b5a52dad5efe9b631c894 100644 (file)
@@ -115,8 +115,7 @@ static void measure_achieved_throughput(struct sock *sk, u32 pkts_acked, s32 rtt
                return;
 
        /* achieved throughput calculations */
-       if (icsk->icsk_ca_state != TCP_CA_Open &&
-           icsk->icsk_ca_state != TCP_CA_Disorder) {
+       if (!((1 << icsk->icsk_ca_state) & (TCPF_CA_Open | TCPF_CA_Disorder))) {
                ca->packetcount = 0;
                ca->lasttime = now;
                return;