]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
net: packet: use reciprocal_divide in fanout_demux_hash
authorDaniel Borkmann <dborkman@redhat.com>
Wed, 28 Aug 2013 20:13:10 +0000 (22:13 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 29 Aug 2013 20:43:29 +0000 (16:43 -0400)
Instead of hard-coding reciprocal_divide function, use the inline
function from reciprocal_div.h.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/packet/af_packet.c

index bee9bfdc8d056cd771b0b726eaa6e706df1f0d82..2e8286b47c28e5bef7cb80162e12ddb8ca4b358e 100644 (file)
@@ -1135,7 +1135,7 @@ static unsigned int fanout_demux_hash(struct packet_fanout *f,
                                      struct sk_buff *skb,
                                      unsigned int num)
 {
-       return (((u64)skb->rxhash) * num) >> 32;
+       return reciprocal_divide(skb->rxhash, num);
 }
 
 static unsigned int fanout_demux_lb(struct packet_fanout *f,