aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorVeaceslav Falico <vfalico@redhat.com>2013-09-27 10:11:58 -0400
committerDavid S. Miller <davem@davemloft.net>2013-09-28 18:28:00 -0400
commitfe9323dae5a05eb3d582d5546219c601862dd082 (patch)
tree1345b2e238c7104372405c04fadbb04a95b0a9a3 /drivers
parent3c4c88a138f0857b9e77266e09ad147d17629401 (diff)
bonding: remove __get_first_port()
Currently we have only one user of it, so it's kind of useless and just obfusicates things. Remove it and move the logic to the only user - bond_3ad_state_machine_handler(). 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')
-rw-r--r--drivers/net/bonding/bond_3ad.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
index c1535f8762d1..0f86d2bd54b8 100644
--- a/drivers/net/bonding/bond_3ad.c
+++ b/drivers/net/bonding/bond_3ad.c
@@ -136,19 +136,6 @@ static inline struct bonding *__get_bond_by_port(struct port *port)
136} 136}
137 137
138/** 138/**
139 * __get_first_port - get the first port in the bond
140 * @bond: the bond we're looking at
141 *
142 * Return the port of the first slave in @bond, or %NULL if it can't be found.
143 */
144static inline struct port *__get_first_port(struct bonding *bond)
145{
146 struct slave *first_slave = bond_first_slave(bond);
147
148 return first_slave ? &(SLAVE_AD_INFO(first_slave).port) : NULL;
149}
150
151/**
152 * __get_first_agg - get the first aggregator in the bond 139 * __get_first_agg - get the first aggregator in the bond
153 * @bond: the bond we're looking at 140 * @bond: the bond we're looking at
154 * 141 *
@@ -2104,8 +2091,11 @@ void bond_3ad_state_machine_handler(struct work_struct *work)
2104 2091
2105 // check if agg_select_timer timer after initialize is timed out 2092 // check if agg_select_timer timer after initialize is timed out
2106 if (BOND_AD_INFO(bond).agg_select_timer && !(--BOND_AD_INFO(bond).agg_select_timer)) { 2093 if (BOND_AD_INFO(bond).agg_select_timer && !(--BOND_AD_INFO(bond).agg_select_timer)) {
2094 slave = bond_first_slave(bond);
2095 port = slave ? &(SLAVE_AD_INFO(slave).port) : NULL;
2096
2107 // select the active aggregator for the bond 2097 // select the active aggregator for the bond
2108 if ((port = __get_first_port(bond))) { 2098 if (port) {
2109 if (!port->slave) { 2099 if (!port->slave) {
2110 pr_warning("%s: Warning: bond's first port is uninitialized\n", 2100 pr_warning("%s: Warning: bond's first port is uninitialized\n",
2111 bond->dev->name); 2101 bond->dev->name);