diff options
author | Stephen Hemminger <shemminger@linux-foundation.org> | 2007-03-25 22:54:23 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-26 01:23:33 -0400 |
commit | 3927f2e8f9afa3424bb51ca81f7abac01ffd0005 (patch) | |
tree | da9e335169572e6c743c084edce6a802f9e667ee /net/ipv4/tcp_yeah.c | |
parent | 9d729f72dca9406025bcfa9c1f660d71d9ef0ff5 (diff) |
[NET]: div64_64 consolidate (rev3)
Here is the current version of the 64 bit divide common code.
Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_yeah.c')
-rw-r--r-- | net/ipv4/tcp_yeah.c | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/net/ipv4/tcp_yeah.c b/net/ipv4/tcp_yeah.c index 815e020e98fe..18355a2608e1 100644 --- a/net/ipv4/tcp_yeah.c +++ b/net/ipv4/tcp_yeah.c | |||
@@ -73,27 +73,6 @@ static void tcp_yeah_pkts_acked(struct sock *sk, u32 pkts_acked) | |||
73 | yeah->pkts_acked = pkts_acked; | 73 | yeah->pkts_acked = pkts_acked; |
74 | } | 74 | } |
75 | 75 | ||
76 | /* 64bit divisor, dividend and result. dynamic precision */ | ||
77 | static inline u64 div64_64(u64 dividend, u64 divisor) | ||
78 | { | ||
79 | u32 d = divisor; | ||
80 | |||
81 | if (divisor > 0xffffffffULL) { | ||
82 | unsigned int shift = fls(divisor >> 32); | ||
83 | |||
84 | d = divisor >> shift; | ||
85 | dividend >>= shift; | ||
86 | } | ||
87 | |||
88 | /* avoid 64 bit division if possible */ | ||
89 | if (dividend >> 32) | ||
90 | do_div(dividend, d); | ||
91 | else | ||
92 | dividend = (u32) dividend / d; | ||
93 | |||
94 | return dividend; | ||
95 | } | ||
96 | |||
97 | static void tcp_yeah_cong_avoid(struct sock *sk, u32 ack, | 76 | static void tcp_yeah_cong_avoid(struct sock *sk, u32 ack, |
98 | u32 seq_rtt, u32 in_flight, int flag) | 77 | u32 seq_rtt, u32 in_flight, int flag) |
99 | { | 78 | { |