Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 344f3297 authored by Veaceslav Falico's avatar Veaceslav Falico Committed by David S. Miller
Browse files

bonding: use neighbours for bond_next_slave()



Use the new function __bond_next_slave().

CC: Jay Vosburgh <fubar@us.ibm.com>
CC: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: default avatarVeaceslav Falico <vfalico@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 18e1e9bc
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -76,8 +76,6 @@

#define bond_has_slaves(bond) !list_empty(bond_slave_list(bond))

#define bond_to_slave(ptr) list_entry(ptr, struct slave, list)

/* IMPORTANT: bond_first/last_slave can return NULL in case of an empty list */
#define bond_first_slave(bond) \
	(bond_has_slaves(bond) ? \
@@ -92,9 +90,7 @@
#define bond_is_last_slave(bond, pos) (pos == bond_last_slave(bond))

/* Since bond_first/last_slave can return NULL, these can return NULL too */
#define bond_next_slave(bond, pos) \
	(bond_is_last_slave(bond, pos) ? bond_first_slave(bond) : \
					 bond_to_slave((pos)->list.next))
#define bond_next_slave(bond, pos) __bond_next_slave(bond, pos)

/**
 * bond_for_each_slave - iterate over all slaves