diff options
author | Veaceslav Falico <vfalico@redhat.com> | 2013-09-25 03:20:27 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-09-26 16:02:07 -0400 |
commit | 344f3297629e409675120998d1cfe4d21c34fbaa (patch) | |
tree | 0d02cf656ab430c9064f2d5b5ccdf2876d734a9d /drivers/net/bonding/bonding.h | |
parent | 18e1e9bc5d1b9b89853a23aaeeed39686a95551b (diff) |
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: Veaceslav Falico <vfalico@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding/bonding.h')
-rw-r--r-- | drivers/net/bonding/bonding.h | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h index 4a3fbe307ee8..f070557c21ea 100644 --- a/drivers/net/bonding/bonding.h +++ b/drivers/net/bonding/bonding.h | |||
@@ -76,8 +76,6 @@ | |||
76 | 76 | ||
77 | #define bond_has_slaves(bond) !list_empty(bond_slave_list(bond)) | 77 | #define bond_has_slaves(bond) !list_empty(bond_slave_list(bond)) |
78 | 78 | ||
79 | #define bond_to_slave(ptr) list_entry(ptr, struct slave, list) | ||
80 | |||
81 | /* IMPORTANT: bond_first/last_slave can return NULL in case of an empty list */ | 79 | /* IMPORTANT: bond_first/last_slave can return NULL in case of an empty list */ |
82 | #define bond_first_slave(bond) \ | 80 | #define bond_first_slave(bond) \ |
83 | (bond_has_slaves(bond) ? \ | 81 | (bond_has_slaves(bond) ? \ |
@@ -92,9 +90,7 @@ | |||
92 | #define bond_is_last_slave(bond, pos) (pos == bond_last_slave(bond)) | 90 | #define bond_is_last_slave(bond, pos) (pos == bond_last_slave(bond)) |
93 | 91 | ||
94 | /* Since bond_first/last_slave can return NULL, these can return NULL too */ | 92 | /* Since bond_first/last_slave can return NULL, these can return NULL too */ |
95 | #define bond_next_slave(bond, pos) \ | 93 | #define bond_next_slave(bond, pos) __bond_next_slave(bond, pos) |
96 | (bond_is_last_slave(bond, pos) ? bond_first_slave(bond) : \ | ||
97 | bond_to_slave((pos)->list.next)) | ||
98 | 94 | ||
99 | /** | 95 | /** |
100 | * bond_for_each_slave - iterate over all slaves | 96 | * bond_for_each_slave - iterate over all slaves |