diff options
author | Daniel Borkmann <dborkman@redhat.com> | 2014-08-23 14:58:54 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-08-23 15:21:21 -0400 |
commit | 8fc54f68919298ff9689d980efb495707ef43f30 (patch) | |
tree | c8a0c89621a9e670be02764a357bb6e73ed7ab6c /net/sched/sch_fq_codel.c | |
parent | 690e36e726d00d2528bc569809048adf61550d80 (diff) |
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/sched/sch_fq_codel.c')
-rw-r--r-- | net/sched/sch_fq_codel.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/sched/sch_fq_codel.c b/net/sched/sch_fq_codel.c index 063b726bf1f8..cc56c8bb9bed 100644 --- a/net/sched/sch_fq_codel.c +++ b/net/sched/sch_fq_codel.c | |||
@@ -77,7 +77,8 @@ static unsigned int fq_codel_hash(const struct fq_codel_sched_data *q, | |||
77 | hash = jhash_3words((__force u32)keys.dst, | 77 | hash = jhash_3words((__force u32)keys.dst, |
78 | (__force u32)keys.src ^ keys.ip_proto, | 78 | (__force u32)keys.src ^ keys.ip_proto, |
79 | (__force u32)keys.ports, q->perturbation); | 79 | (__force u32)keys.ports, q->perturbation); |
80 | return ((u64)hash * q->flows_cnt) >> 32; | 80 | |
81 | return reciprocal_scale(hash, q->flows_cnt); | ||
81 | } | 82 | } |
82 | 83 | ||
83 | static unsigned int fq_codel_classify(struct sk_buff *skb, struct Qdisc *sch, | 84 | static unsigned int fq_codel_classify(struct sk_buff *skb, struct Qdisc *sch, |