summaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding
diff options
context:
space:
mode:
authorHolger Eitzenberger <holger@eitzenberger.org>2008-12-17 19:13:27 -0800
committerDavid S. Miller <davem@davemloft.net>2008-12-17 19:13:27 -0800
commit3c52065fbbf3bd11776d63d43e18d0fd285b02e2 (patch)
tree665cb32e0ee77c27e3f200420e6604731c9b9ab6 /drivers/net/bonding
parentce6a49ad401d78ff1f66e2a55cf445d0f45d8146 (diff)
bonding: use port_params in __update_default_selected()
I also removed some of the unneeded braces in the if condition to improve readability and a little bit of reformatting. Signed-off-by: Holger Eitzenberger <holger@eitzenberger.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding')
-rw-r--r--drivers/net/bonding/bond_3ad.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
index 4792e12a7f2..dc13450d1e0 100644
--- a/drivers/net/bonding/bond_3ad.c
+++ b/drivers/net/bonding/bond_3ad.c
@@ -543,16 +543,18 @@ static void __update_selected(struct lacpdu *lacpdu, struct port *port)
*/
static void __update_default_selected(struct port *port)
{
- // validate the port
if (port) {
+ const struct port_params *admin = &port->partner_admin;
+ const struct port_params *oper = &port->partner_oper;
+
// check if any parameter is different
- if ((port->partner_admin.port_number != port->partner_oper.port_number) ||
- (port->partner_admin.port_priority != port->partner_oper.port_priority) ||
- MAC_ADDRESS_COMPARE(&(port->partner_admin.system), &(port->partner_oper.system)) ||
- (port->partner_admin.system_priority != port->partner_oper.system_priority) ||
- (port->partner_admin.key != port->partner_oper.key) ||
- ((port->partner_admin.port_state & AD_STATE_AGGREGATION) != (port->partner_oper.port_state & AD_STATE_AGGREGATION))
- ) {
+ if (admin->port_number != oper->port_number
+ || admin->port_priority != oper->port_priority
+ || MAC_ADDRESS_COMPARE(&admin->system, &oper->system)
+ || admin->system_priority != oper->system_priority
+ || admin->key != oper->key
+ || (admin->port_state & AD_STATE_AGGREGATION)
+ != (oper->port_state & AD_STATE_AGGREGATION)) {
// update the state machine Selected variable
port->sm_vars &= ~AD_PORT_SELECTED;
}