]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/ipv4/tcp_output.c
[TCP] Avoid two divides in tcp_output.c
[linux-2.6-omap-h63xx.git] / net / ipv4 / tcp_output.c
index 7c50271ddc30e05aabc6908d1ebb56fa5d40a22a..9a9510acb147ff555320e7b460612708a00dcad1 100644 (file)
@@ -1627,7 +1627,7 @@ u32 __tcp_select_window(struct sock *sk)
        if (mss > full_space)
                mss = full_space;
 
-       if (free_space < full_space/2) {
+       if (free_space < (full_space >> 1)) {
                icsk->icsk_ack.quick = 0;
 
                if (tcp_memory_pressure)
@@ -1666,7 +1666,7 @@ u32 __tcp_select_window(struct sock *sk)
                if (window <= free_space - mss || window > free_space)
                        window = (free_space/mss)*mss;
                else if (mss == full_space &&
-                        free_space > window + full_space/2)
+                        free_space > window + (full_space >> 1))
                        window = free_space;
        }