aboutsummaryrefslogtreecommitdiffstats
path: root/net/netfilter/ipvs/ip_vs_wrr.c
diff options
context:
space:
mode:
authorFlorian Fainelli <florian@openwrt.org>2009-12-22 09:42:06 +0100
committerPatrick McHardy <kaber@trash.net>2009-12-22 09:42:06 +0100
commitae24e578de02b87cce3dc59248c29b2ecb071e9e (patch)
treeaa8bca747bb40bd0763f0fcac20ad0b2ce0f567b /net/netfilter/ipvs/ip_vs_wrr.c
parent258c889362aa95d0ab534b38ce8c15d3009705b1 (diff)
downloadkernel_samsung_smdk4412-ae24e578de02b87cce3dc59248c29b2ecb071e9e.zip
kernel_samsung_smdk4412-ae24e578de02b87cce3dc59248c29b2ecb071e9e.tar.gz
kernel_samsung_smdk4412-ae24e578de02b87cce3dc59248c29b2ecb071e9e.tar.bz2
ipvs: ip_vs_wrr.c: use lib/gcd.c
Remove the private version of the greatest common divider to use lib/gcd.c, the latter also implementing the a < b case. [akpm@linux-foundation.org: repair neighboring whitespace because the diff looked odd] Signed-off-by: Florian Fainelli <florian@openwrt.org> Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com> Cc: Takashi Iwai <tiwai@suse.de> Acked-by: Simon Horman <horms@verge.net.au> Cc: Julius Volz <juliusv@google.com> Cc: David S. Miller <davem@davemloft.net> Cc: Patrick McHardy <kaber@trash.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'net/netfilter/ipvs/ip_vs_wrr.c')
-rw-r--r--net/netfilter/ipvs/ip_vs_wrr.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/net/netfilter/ipvs/ip_vs_wrr.c b/net/netfilter/ipvs/ip_vs_wrr.c
index 6182e8e..3c115fc 100644
--- a/net/netfilter/ipvs/ip_vs_wrr.c
+++ b/net/netfilter/ipvs/ip_vs_wrr.c
@@ -24,6 +24,7 @@
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/net.h>
+#include <linux/gcd.h>
#include <net/ip_vs.h>
@@ -38,20 +39,6 @@ struct ip_vs_wrr_mark {
};
-/*
- * Get the gcd of server weights
- */
-static int gcd(int a, int b)
-{
- int c;
-
- while ((c = a % b)) {
- a = b;
- b = c;
- }
- return b;
-}
-
static int ip_vs_wrr_gcd_weight(struct ip_vs_service *svc)
{
struct ip_vs_dest *dest;