aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding/bond_sysfs.c
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@openvz.org>2008-05-18 00:10:10 -0400
committerJeff Garzik <jgarzik@redhat.com>2008-05-22 06:34:22 -0400
commit0883beca7f39ab0c6447af35080e5caaa07418e3 (patch)
tree160996e2c3483095ec5a1b88cfa975a6f1982533 /drivers/net/bonding/bond_sysfs.c
parent0dd646fe0549251e79d6fb03e6773bcc6ccea61f (diff)
bonding: Relax unneeded _safe lists iterations.
Many places either do not modify the list under the list_for_each_xxx, or break out of the loop as soon as the first element is removed. Thus, this _safe iteration just occupies some unneeded .text space and requires an additional variable. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Acked-by: Jay Vosburgh <fubar@us.ibm.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net/bonding/bond_sysfs.c')
-rw-r--r--drivers/net/bonding/bond_sysfs.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
index 452a789bf2eb..1f028579e53b 100644
--- a/drivers/net/bonding/bond_sysfs.c
+++ b/drivers/net/bonding/bond_sysfs.c
@@ -111,7 +111,6 @@ static ssize_t bonding_store_bonds(struct class *cls, const char *buffer, size_t
111 char *ifname; 111 char *ifname;
112 int rv, res = count; 112 int rv, res = count;
113 struct bonding *bond; 113 struct bonding *bond;
114 struct bonding *nxt;
115 114
116 sscanf(buffer, "%16s", command); /* IFNAMSIZ*/ 115 sscanf(buffer, "%16s", command); /* IFNAMSIZ*/
117 ifname = command + 1; 116 ifname = command + 1;
@@ -134,7 +133,7 @@ static ssize_t bonding_store_bonds(struct class *cls, const char *buffer, size_t
134 rtnl_lock(); 133 rtnl_lock();
135 down_write(&bonding_rwsem); 134 down_write(&bonding_rwsem);
136 135
137 list_for_each_entry_safe(bond, nxt, &bond_dev_list, bond_list) 136 list_for_each_entry(bond, &bond_dev_list, bond_list)
138 if (strnicmp(bond->dev->name, ifname, IFNAMSIZ) == 0) { 137 if (strnicmp(bond->dev->name, ifname, IFNAMSIZ) == 0) {
139 /* check the ref count on the bond's kobject. 138 /* check the ref count on the bond's kobject.
140 * If it's > expected, then there's a file open, 139 * If it's > expected, then there's a file open,