| To: | "Linux-MIPS" <linux-mips@linux-mips.org>, Ralf Baechle <ralf@linux-mips.org>, Andrew Morton <akpm@linux-foundation.org>, netdev@vger.kernel.org, David Miller <davem@davemloft.net>, linux-kernel@vger.kernel.org |
|---|---|
| Subject: | [PATCH 3/8] net/netfilter/ipvs/ip_vs_wrr.c: use lib/gcd.c |
| From: | Florian Fainelli <florian@openwrt.org> |
| Date: | Thu, 4 Jun 2009 16:16:21 +0200 |
| Dkim-signature: | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:from:date:subject :mime-version:x-uid:x-length:to:content-type :content-transfer-encoding:content-disposition:message-id; bh=jtUiUlE8ZU+vjaOtSZWz8uZ0ZbZrZ6KemPqnZuLtCqU=; b=ICB5pWEEdlMU6JO/7RuMCX9Y4TfEocUC9EAyUlVRKthjuGrUV8RQ6fynxqS9d/Iy0X eMa81AYuuY2GSxGsPzjE7BkhgYFdJ9qMThoDFkEfYH/1phaeECvxHdljXhyzghWdps8x PzTu6xZJVp2FFCGLq2715rGgwuF/U6ZTaxozU= |
| Domainkey-signature: | a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:date:subject:mime-version:x-uid:x-length:to :content-type:content-transfer-encoding:content-disposition :message-id; b=Fy+H5dWVI/vsMLg4W1bvwXu2UibIsd+WuKxBEFascLy1brAXQbmqStiZMGyXkKnZWK xZ63zB+BmTTx6zizX64Fxmf3oCp7xqZEo8FnTHC1I64K9E4ArrHSu8giLGPsAba4mrjB dhm3D4yDMxPtIzQVZlMlxEGBsgA4V/9j41B7g= |
| Original-recipient: | rfc822;linux-mips@linux-mips.org |
| Sender: | linux-mips-bounce@linux-mips.org |
This patch removes the open-coded version of the
greatest common divider to use lib/gcd.c, the latter
also implementing the a < b case.
Signed-off-by: Florian Fainelli <florian@openwrt.org>
---
diff --git a/net/netfilter/ipvs/Kconfig b/net/netfilter/ipvs/Kconfig
index 79a6980..5b37675 100644
--- a/net/netfilter/ipvs/Kconfig
+++ b/net/netfilter/ipvs/Kconfig
@@ -113,6 +113,7 @@ config IP_VS_RR
config IP_VS_WRR
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 --git a/net/netfilter/ipvs/ip_vs_wrr.c b/net/netfilter/ipvs/ip_vs_wrr.c
index f7d74ef..8701212 100644
--- a/net/netfilter/ipvs/ip_vs_wrr.c
+++ b/net/netfilter/ipvs/ip_vs_wrr.c
@@ -21,6 +21,7 @@
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/net.h>
+#include <linux/gcd.h>
#include <net/ip_vs.h>
@@ -35,20 +36,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;
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | [PATCH 2/8] sound/core/pcm_timer.c: use lib/gcd.c, Florian Fainelli |
|---|---|
| Next by Date: | [PATCH 4/8] add support for the TI VLYNQ bus, Florian Fainelli |
| Previous by Thread: | [PATCH 2/8] sound/core/pcm_timer.c: use lib/gcd.c, Florian Fainelli |
| Next by Thread: | Re: [PATCH 3/8] net/netfilter/ipvs/ip_vs_wrr.c: use lib/gcd.c, Simon Horman |
| Indexes: | [Date] [Thread] [Top] [All Lists] |