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/netfilter | |
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/netfilter')
-rw-r--r-- | net/netfilter/xt_connbytes.c | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/net/netfilter/xt_connbytes.c b/net/netfilter/xt_connbytes.c index 5e32dfa2668..302043bc41b 100644 --- a/net/netfilter/xt_connbytes.c +++ b/net/netfilter/xt_connbytes.c | |||
@@ -24,22 +24,6 @@ MODULE_AUTHOR("Harald Welte <laforge@netfilter.org>"); | |||
24 | MODULE_DESCRIPTION("iptables match for matching number of pkts/bytes per connection"); | 24 | MODULE_DESCRIPTION("iptables match for matching number of pkts/bytes per connection"); |
25 | MODULE_ALIAS("ipt_connbytes"); | 25 | MODULE_ALIAS("ipt_connbytes"); |
26 | 26 | ||
27 | /* 64bit divisor, dividend and result. dynamic precision */ | ||
28 | static u_int64_t div64_64(u_int64_t dividend, u_int64_t divisor) | ||
29 | { | ||
30 | u_int32_t d = divisor; | ||
31 | |||
32 | if (divisor > 0xffffffffULL) { | ||
33 | unsigned int shift = fls(divisor >> 32); | ||
34 | |||
35 | d = divisor >> shift; | ||
36 | dividend >>= shift; | ||
37 | } | ||
38 | |||
39 | do_div(dividend, d); | ||
40 | return dividend; | ||
41 | } | ||
42 | |||
43 | static int | 27 | static int |
44 | match(const struct sk_buff *skb, | 28 | match(const struct sk_buff *skb, |
45 | const struct net_device *in, | 29 | const struct net_device *in, |