# This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1353 -> 1.1354 # net/ipv4/ipvs/ip_vs_wrr.c 1.2 -> 1.3 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/09/27 ja@xxxxxx 1.1354 # [IPV4/IPVS] Simplify ip_vs_wrr_gcd_weight # -------------------------------------------- # diff -Nru a/net/ipv4/ipvs/ip_vs_wrr.c b/net/ipv4/ipvs/ip_vs_wrr.c --- a/net/ipv4/ipvs/ip_vs_wrr.c Sat Sep 27 11:06:29 2003 +++ b/net/ipv4/ipvs/ip_vs_wrr.c Sat Sep 27 11:06:29 2003 @@ -58,26 +58,18 @@ { struct ip_vs_dest *dest; int weight; - int g = 1; + int g = 0; list_for_each_entry(dest, &svc->destinations, n_list) { weight = atomic_read(&dest->weight); if (weight > 0) { - g = weight; - goto search_gcd; + if (g > 0) + g = gcd(weight, g); + else + g = weight; } } - - return g; - - search_gcd: - list_for_each_entry(dest, &svc->destinations, n_list) { - weight = atomic_read(&dest->weight); - if (weight > 0) - g = gcd(weight, g); - } - - return g; + return g ? g : 1; }