summaryrefslogtreecommitdiffstats
path: root/net/netfilter/nf_conntrack_core.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_core.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_core.c')
-rw-r--r--net/netfilter/nf_conntrack_core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c
index 0b634e7f1652..5016a6929085 100644
--- a/net/netfilter/nf_conntrack_core.c
+++ b/net/netfilter/nf_conntrack_core.c
@@ -142,7 +142,7 @@ static u32 hash_conntrack_raw(const struct nf_conntrack_tuple *tuple, u16 zone)
static u32 __hash_bucket(u32 hash, unsigned int size)
{
- return ((u64)hash * size) >> 32;
+ return reciprocal_scale(hash, size);
}
static u32 hash_bucket(u32 hash, const struct net *net)