]> git.openpandora.org Git - pandora-kernel.git/commitdiff
tcp: whitespace fixes
authorstephen hemminger <stephen@networkplumber.org>
Sat, 30 Aug 2014 06:32:05 +0000 (23:32 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 2 Sep 2014 01:12:45 +0000 (18:12 -0700)
Fix places where there is space before tab, long lines, and
awkward if(){, double spacing etc. Add blank line after declaration/initialization.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
15 files changed:
net/ipv4/tcp_bic.c
net/ipv4/tcp_cong.c
net/ipv4/tcp_cubic.c
net/ipv4/tcp_diag.c
net/ipv4/tcp_highspeed.c
net/ipv4/tcp_htcp.c
net/ipv4/tcp_hybla.c
net/ipv4/tcp_illinois.c
net/ipv4/tcp_ipv4.c
net/ipv4/tcp_probe.c
net/ipv4/tcp_scalable.c
net/ipv4/tcp_vegas.c
net/ipv4/tcp_veno.c
net/ipv4/tcp_westwood.c
net/ipv4/tcp_yeah.c

index d5de69bc04f581ac589ae0f6fe7fcc3646b2cc3e..bb395d46a3898136afe615c73ac311fd2832f6f1 100644 (file)
@@ -17,7 +17,6 @@
 #include <linux/module.h>
 #include <net/tcp.h>
 
-
 #define BICTCP_BETA_SCALE    1024      /* Scale factor beta calculation
                                         * max_cwnd = snd_cwnd * beta
                                         */
@@ -46,11 +45,10 @@ MODULE_PARM_DESC(initial_ssthresh, "initial value of slow start threshold");
 module_param(smooth_part, int, 0644);
 MODULE_PARM_DESC(smooth_part, "log(B/(B*Smin))/log(B/(B-1))+B, # of RTT from Wmax-B to Wmax");
 
-
 /* BIC TCP Parameters */
 struct bictcp {
        u32     cnt;            /* increase cwnd by 1 after ACKs */
-       u32     last_max_cwnd;  /* last maximum snd_cwnd */
+       u32     last_max_cwnd;  /* last maximum snd_cwnd */
        u32     loss_cwnd;      /* congestion window at last loss */
        u32     last_cwnd;      /* the last snd_cwnd */
        u32     last_time;      /* time when updated last_cwnd */
@@ -103,7 +101,7 @@ static inline void bictcp_update(struct bictcp *ca, u32 cwnd)
 
        /* binary increase */
        if (cwnd < ca->last_max_cwnd) {
-               __u32   dist = (ca->last_max_cwnd - cwnd)
+               __u32   dist = (ca->last_max_cwnd - cwnd)
                        / BICTCP_B;
 
                if (dist > max_increment)
@@ -154,7 +152,6 @@ static void bictcp_cong_avoid(struct sock *sk, u32 ack, u32 acked)
                bictcp_update(ca, tp->snd_cwnd);
                tcp_cong_avoid_ai(tp, ca->cnt);
        }
-
 }
 
 /*
@@ -177,7 +174,6 @@ static u32 bictcp_recalc_ssthresh(struct sock *sk)
 
        ca->loss_cwnd = tp->snd_cwnd;
 
-
        if (tp->snd_cwnd <= low_window)
                return max(tp->snd_cwnd >> 1U, 2U);
        else
@@ -188,6 +184,7 @@ static u32 bictcp_undo_cwnd(struct sock *sk)
 {
        const struct tcp_sock *tp = tcp_sk(sk);
        const struct bictcp *ca = inet_csk_ca(sk);
+
        return max(tp->snd_cwnd, ca->loss_cwnd);
 }
 
@@ -206,12 +203,12 @@ static void bictcp_acked(struct sock *sk, u32 cnt, s32 rtt)
 
        if (icsk->icsk_ca_state == TCP_CA_Open) {
                struct bictcp *ca = inet_csk_ca(sk);
+
                cnt -= ca->delayed_ack >> ACK_RATIO_SHIFT;
                ca->delayed_ack += cnt;
        }
 }
 
-
 static struct tcp_congestion_ops bictcp __read_mostly = {
        .init           = bictcp_init,
        .ssthresh       = bictcp_recalc_ssthresh,
index 7b09d8b49fa51271cc0fa99a3fcda9f017c0f469..80248f56c89f0b3dc8481aea2212fac819924772 100644 (file)
@@ -142,7 +142,6 @@ static int __init tcp_congestion_default(void)
 }
 late_initcall(tcp_congestion_default);
 
-
 /* Build string with list of available congestion control values */
 void tcp_get_available_congestion_control(char *buf, size_t maxlen)
 {
@@ -154,7 +153,6 @@ void tcp_get_available_congestion_control(char *buf, size_t maxlen)
                offs += snprintf(buf + offs, maxlen - offs,
                                 "%s%s",
                                 offs == 0 ? "" : " ", ca->name);
-
        }
        rcu_read_unlock();
 }
@@ -186,7 +184,6 @@ void tcp_get_allowed_congestion_control(char *buf, size_t maxlen)
                offs += snprintf(buf + offs, maxlen - offs,
                                 "%s%s",
                                 offs == 0 ? "" : " ", ca->name);
-
        }
        rcu_read_unlock();
 }
@@ -230,7 +227,6 @@ out:
        return ret;
 }
 
-
 /* Change congestion control for socket */
 int tcp_set_congestion_control(struct sock *sk, const char *name)
 {
@@ -337,6 +333,7 @@ EXPORT_SYMBOL_GPL(tcp_reno_cong_avoid);
 u32 tcp_reno_ssthresh(struct sock *sk)
 {
        const struct tcp_sock *tp = tcp_sk(sk);
+
        return max(tp->snd_cwnd >> 1U, 2U);
 }
 EXPORT_SYMBOL_GPL(tcp_reno_ssthresh);
index a9bd8a4828a9e5c2da275626c11c6c953a1b3dd6..20de0118c98e455447128513610ba04b13f3cd61 100644 (file)
@@ -82,12 +82,13 @@ MODULE_PARM_DESC(hystart_ack_delta, "spacing between ack's indicating train (mse
 /* BIC TCP Parameters */
 struct bictcp {
        u32     cnt;            /* increase cwnd by 1 after ACKs */
-       u32     last_max_cwnd;  /* last maximum snd_cwnd */
+       u32     last_max_cwnd;  /* last maximum snd_cwnd */
        u32     loss_cwnd;      /* congestion window at last loss */
        u32     last_cwnd;      /* the last snd_cwnd */
        u32     last_time;      /* time when updated last_cwnd */
        u32     bic_origin_point;/* origin point of bic function */
-       u32     bic_K;          /* time to origin point from the beginning of the current epoch */
+       u32     bic_K;          /* time to origin point
+                                  from the beginning of the current epoch */
        u32     delay_min;      /* min delay (msec << 3) */
        u32     epoch_start;    /* beginning of an epoch */
        u32     ack_cnt;        /* number of acks */
@@ -219,7 +220,7 @@ static inline void bictcp_update(struct bictcp *ca, u32 cwnd)
        ca->last_time = tcp_time_stamp;
 
        if (ca->epoch_start == 0) {
-               ca->epoch_start = tcp_time_stamp;       /* record the beginning of an epoch */
+               ca->epoch_start = tcp_time_stamp;       /* record beginning */
                ca->ack_cnt = 1;                        /* start counting */
                ca->tcp_cwnd = cwnd;                    /* syn with cubic */
 
@@ -263,9 +264,9 @@ static inline void bictcp_update(struct bictcp *ca, u32 cwnd)
 
        /* c/rtt * (t-K)^3 */
        delta = (cube_rtt_scale * offs * offs * offs) >> (10+3*BICTCP_HZ);
-       if (t < ca->bic_K)                                      /* below origin*/
+       if (t < ca->bic_K)                            /* below origin*/
                bic_target = ca->bic_origin_point - delta;
-       else                                                    /* above origin*/
+       else                                          /* above origin*/
                bic_target = ca->bic_origin_point + delta;
 
        /* cubic function - calc bictcp_cnt*/
@@ -285,13 +286,14 @@ static inline void bictcp_update(struct bictcp *ca, u32 cwnd)
        /* TCP Friendly */
        if (tcp_friendliness) {
                u32 scale = beta_scale;
+
                delta = (cwnd * scale) >> 3;
                while (ca->ack_cnt > delta) {           /* update tcp cwnd */
                        ca->ack_cnt -= delta;
                        ca->tcp_cwnd++;
                }
 
-               if (ca->tcp_cwnd > cwnd){       /* if bic is slower than tcp */
+               if (ca->tcp_cwnd > cwnd) {      /* if bic is slower than tcp */
                        delta = ca->tcp_cwnd - cwnd;
                        max_cnt = cwnd / delta;
                        if (ca->cnt > max_cnt)
@@ -320,7 +322,6 @@ static void bictcp_cong_avoid(struct sock *sk, u32 ack, u32 acked)
                bictcp_update(ca, tp->snd_cwnd);
                tcp_cong_avoid_ai(tp, ca->cnt);
        }
-
 }
 
 static u32 bictcp_recalc_ssthresh(struct sock *sk)
@@ -452,7 +453,8 @@ static int __init cubictcp_register(void)
         * based on SRTT of 100ms
         */
 
-       beta_scale = 8*(BICTCP_BETA_SCALE+beta)/ 3 / (BICTCP_BETA_SCALE - beta);
+       beta_scale = 8*(BICTCP_BETA_SCALE+beta) / 3
+               / (BICTCP_BETA_SCALE - beta);
 
        cube_rtt_scale = (bic_scale * 10);      /* 1024*c/rtt */
 
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge