All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick McHardy <kaber@trash.net>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, Patrick McHardy <kaber@trash.net>,
	netfilter-devel@vger.kernel.org
Subject: ipvs 01/04: ip_vs_wrr.c: use lib/gcd.c
Date: Fri,  8 Jan 2010 17:42:09 +0100 (MET)	[thread overview]
Message-ID: <20100108164206.28066.65576.sendpatchset@x2.localnet> (raw)
In-Reply-To: <20100108164204.28066.44430.sendpatchset@x2.localnet>

commit ae24e578de02b87cce3dc59248c29b2ecb071e9e
Author: Florian Fainelli <florian@openwrt.org>
Date:   Tue Dec 22 09:42:06 2009 +0100

    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>

diff --git a/net/netfilter/ipvs/Kconfig b/net/netfilter/ipvs/Kconfig
index 79a6980..f2d7623 100644
--- a/net/netfilter/ipvs/Kconfig
+++ b/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 --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;

  reply	other threads:[~2010-01-08 16:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-08 16:42 netfilter 00/04: netfilter fixes Patrick McHardy
2010-01-08 16:42 ` Patrick McHardy [this message]
2010-01-08 16:42 ` ipvs 02/04: Add boundary check on ioctl arguments Patrick McHardy
2010-01-08 16:42 ` netfilter 03/04: nf_ct_ftp: fix out of bounds read in update_nl_seq() Patrick McHardy
2010-01-08 16:42 ` netfilter 04/04: ebtables: enforce CAP_NET_ADMIN Patrick McHardy
2010-01-08 21:17 ` netfilter 00/04: netfilter fixes David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100108164206.28066.65576.sendpatchset@x2.localnet \
    --to=kaber@trash.net \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.