Commit 28ccbdde authored by Florian Fainelli's avatar Florian Fainelli Committed by james toy

Remove the private version of the greatest common divider to use

lib/gcd.c, the latter also implementing the a < b case.
Signed-off-by: default avatarFlorian Fainelli <florian@openwrt.org>
Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Takashi Iwai <tiwai@suse.de>
Acked-by: default avatarSimon 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: default avatarAndrew Morton <akpm@linux-foundation.org>
parent 759eda0e
...@@ -113,6 +113,7 @@ config IP_VS_RR ...@@ -113,6 +113,7 @@ config IP_VS_RR
config IP_VS_WRR config IP_VS_WRR
tristate "weighted round-robin scheduling" tristate "weighted round-robin scheduling"
select GCD
---help--- ---help---
The weighted robin-robin scheduling algorithm directs network The weighted robin-robin scheduling algorithm directs network
connections to different real servers based on server weights connections to different real servers based on server weights
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/net.h> #include <linux/net.h>
#include <linux/gcd.h>
#include <net/ip_vs.h> #include <net/ip_vs.h>
...@@ -38,20 +39,6 @@ struct ip_vs_wrr_mark { ...@@ -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) static int ip_vs_wrr_gcd_weight(struct ip_vs_service *svc)
{ {
struct ip_vs_dest *dest; struct ip_vs_dest *dest;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment