summaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding/bond_procfs.c
diff options
context:
space:
mode:
authorVeaceslav Falico <vfalico@redhat.com>2013-09-27 16:12:04 +0200
committerDavid S. Miller <davem@davemloft.net>2013-09-28 15:28:06 -0700
commitf965084535713d952c5bb702806fd6052641b9e9 (patch)
treeb7406b039ed9ec761bb1d438788001f95757badf /drivers/net/bonding/bond_procfs.c
parentda8f0919adcedb7a7b1d343e20c5d044928726d8 (diff)
downloadtalos-op-linux-f965084535713d952c5bb702806fd6052641b9e9.tar.gz
talos-op-linux-f965084535713d952c5bb702806fd6052641b9e9.zip
bonding: don't use bond_next_slave() in bond_info_seq_next()
We don't need the circular loop there and it's the only current user of bond_next_slave() - so just use the standard bond_for_each_slave(). CC: Jay Vosburgh <fubar@us.ibm.com> CC: Andy Gospodarek <andy@greyhouse.net> Signed-off-by: Veaceslav Falico <vfalico@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding/bond_procfs.c')
-rw-r--r--drivers/net/bonding/bond_procfs.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/net/bonding/bond_procfs.c b/drivers/net/bonding/bond_procfs.c
index 7af5646e4410..fb868d6c22da 100644
--- a/drivers/net/bonding/bond_procfs.c
+++ b/drivers/net/bonding/bond_procfs.c
@@ -31,17 +31,25 @@ static void *bond_info_seq_start(struct seq_file *seq, loff_t *pos)
static void *bond_info_seq_next(struct seq_file *seq, void *v, loff_t *pos)
{
struct bonding *bond = seq->private;
- struct slave *slave = v;
+ struct list_head *iter;
+ struct slave *slave;
+ bool found = false;
++*pos;
if (v == SEQ_START_TOKEN)
return bond_first_slave(bond);
- if (bond_is_last_slave(bond, slave))
+ if (bond_is_last_slave(bond, v))
return NULL;
- slave = bond_next_slave(bond, slave);
- return slave;
+ bond_for_each_slave(bond, slave, iter) {
+ if (found)
+ return slave;
+ if (slave == v)
+ found = true;
+ }
+
+ return NULL;
}
static void bond_info_seq_stop(struct seq_file *seq, void *v)
OpenPOWER on IntegriCloud