* [patch 1/1] net/netfilter/ipvs/ip_vs_wrr.c: use lib/gcd.c
@ 2009-12-22 0:37 akpm
2009-12-22 8:43 ` Patrick McHardy
0 siblings, 1 reply; 2+ messages in thread
From: akpm @ 2009-12-22 0:37 UTC (permalink / raw)
To: kaber
Cc: netfilter-devel, akpm, florian, davem, horms, juliusv, sshtylyov,
tiwai
From: Florian Fainelli <florian@openwrt.org>
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>
---
net/netfilter/ipvs/Kconfig | 3 ++-
net/netfilter/ipvs/ip_vs_wrr.c | 15 +--------------
2 files changed, 3 insertions(+), 15 deletions(-)
diff -puN net/netfilter/ipvs/Kconfig~net-netfilter-ipvs-ip_vs_wrrc-use-lib-gcdc net/netfilter/ipvs/Kconfig
--- a/net/netfilter/ipvs/Kconfig~net-netfilter-ipvs-ip_vs_wrrc-use-lib-gcdc
+++ a/net/netfilter/ipvs/Kconfig
@@ -112,7 +112,8 @@ config IP_VS_RR
module, choose M here. If unsure, say N.
config IP_VS_WRR
- tristate "weighted round-robin scheduling"
+ tristate "weighted round-robin scheduling"
+ select GCD
---help---
The weighted robin-robin scheduling algorithm directs network
connections to different real servers based on server weights
diff -puN net/netfilter/ipvs/ip_vs_wrr.c~net-netfilter-ipvs-ip_vs_wrrc-use-lib-gcdc net/netfilter/ipvs/ip_vs_wrr.c
--- a/net/netfilter/ipvs/ip_vs_wrr.c~net-netfilter-ipvs-ip_vs_wrrc-use-lib-gcdc
+++ a/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;
_
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-12-22 8:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-22 0:37 [patch 1/1] net/netfilter/ipvs/ip_vs_wrr.c: use lib/gcd.c akpm
2009-12-22 8:43 ` Patrick McHardy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).