Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b92edbe0b8a36a833c16b0cbafb6e899b81ffc08
Commit:     b92edbe0b8a36a833c16b0cbafb6e899b81ffc08
Parent:     68277accb3a5f004344f4346498640601b8b7016
Author:     Eric Dumazet <[EMAIL PROTECTED]>
AuthorDate: Thu Dec 20 21:48:32 2007 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Jan 28 14:59:41 2008 -0800

    [TCP] Avoid two divides in tcp_output.c
    
    Because 'free_space' variable in __tcp_select_window() is signed,
    expression (free_space / 2) forces compiler to emit an integer divide.
    
    This can be changed to a plain right shift, less expensive.
    
    Signed-off-by: Eric Dumazet <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/ipv4/tcp_output.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 7c50271..9a9510a 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -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;
        }
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to