summaryrefslogtreecommitdiffstats
path: root/net/netfilter/nf_conntrack_expect.c
diff options
context:
space:
mode:
authorDaniel Borkmann2014-08-23 20:58:54 +0200
committerDavid S. Miller2014-08-23 21:21:21 +0200
commit8fc54f68919298ff9689d980efb495707ef43f30 (patch)
treec8a0c89621a9e670be02764a357bb6e73ed7ab6c /net/netfilter/nf_conntrack_expect.c
parentnet: Allow raw buffers to be passed into the flow dissector. (diff)
downloadkernel-qcow2-linux-8fc54f68919298ff9689d980efb495707ef43f30.tar.gz
kernel-qcow2-linux-8fc54f68919298ff9689d980efb495707ef43f30.tar.xz
kernel-qcow2-linux-8fc54f68919298ff9689d980efb495707ef43f30.zip
net: use reciprocal_scale() helper
Replace open codings of (((u64) <x> * <y>) >> 32) with reciprocal_scale(). Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Cc: Hannes Frederic Sowa <hannes@stressinduktion.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/netfilter/nf_conntrack_expect.c')
-rw-r--r--net/netfilter/nf_conntrack_expect.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/netfilter/nf_conntrack_expect.c b/net/netfilter/nf_conntrack_expect.c
index f87e8f68ad45..91a1837acd0e 100644
--- a/net/netfilter/nf_conntrack_expect.c
+++ b/net/netfilter/nf_conntrack_expect.c
@@ -83,7 +83,8 @@ static unsigned int nf_ct_expect_dst_hash(const struct nf_conntrack_tuple *tuple
hash = jhash2(tuple->dst.u3.all, ARRAY_SIZE(tuple->dst.u3.all),
(((tuple->dst.protonum ^ tuple->src.l3num) << 16) |
(__force __u16)tuple->dst.u.all) ^ nf_conntrack_hash_rnd);
- return ((u64)hash * nf_ct_expect_hsize) >> 32;
+
+ return reciprocal_scale(hash, nf_ct_expect_hsize);
}
struct nf_conntrack_expect *