Commit fe9323da authored by Veaceslav Falico's avatar Veaceslav Falico Committed by David S. Miller

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: default avatarVeaceslav Falico <vfalico@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3c4c88a1
...@@ -135,19 +135,6 @@ static inline struct bonding *__get_bond_by_port(struct port *port) ...@@ -135,19 +135,6 @@ static inline struct bonding *__get_bond_by_port(struct port *port)
return bond_get_bond_by_slave(port->slave); return bond_get_bond_by_slave(port->slave);
} }
/**
* __get_first_port - get the first port in the bond
* @bond: the bond we're looking at
*
* Return the port of the first slave in @bond, or %NULL if it can't be found.
*/
static inline struct port *__get_first_port(struct bonding *bond)
{
struct slave *first_slave = bond_first_slave(bond);
return first_slave ? &(SLAVE_AD_INFO(first_slave).port) : NULL;
}
/** /**
* __get_first_agg - get the first aggregator in the bond * __get_first_agg - get the first aggregator in the bond
* @bond: the bond we're looking at * @bond: the bond we're looking at
...@@ -2104,8 +2091,11 @@ void bond_3ad_state_machine_handler(struct work_struct *work) ...@@ -2104,8 +2091,11 @@ void bond_3ad_state_machine_handler(struct work_struct *work)
// check if agg_select_timer timer after initialize is timed out // check if agg_select_timer timer after initialize is timed out
if (BOND_AD_INFO(bond).agg_select_timer && !(--BOND_AD_INFO(bond).agg_select_timer)) { if (BOND_AD_INFO(bond).agg_select_timer && !(--BOND_AD_INFO(bond).agg_select_timer)) {
slave = bond_first_slave(bond);
port = slave ? &(SLAVE_AD_INFO(slave).port) : NULL;
// select the active aggregator for the bond // select the active aggregator for the bond
if ((port = __get_first_port(bond))) { if (port) {
if (!port->slave) { if (!port->slave) {
pr_warning("%s: Warning: bond's first port is uninitialized\n", pr_warning("%s: Warning: bond's first port is uninitialized\n",
bond->dev->name); bond->dev->name);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment