diff options
author | Holger Eitzenberger <holger@eitzenberger.org> | 2008-12-17 22:13:27 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-12-17 22:13:27 -0500 |
commit | 3c52065fbbf3bd11776d63d43e18d0fd285b02e2 (patch) | |
tree | 665cb32e0ee77c27e3f200420e6604731c9b9ab6 /drivers/net/bonding/bond_3ad.c | |
parent | ce6a49ad401d78ff1f66e2a55cf445d0f45d8146 (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/bond_3ad.c')
-rw-r--r-- | drivers/net/bonding/bond_3ad.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c index 4792e12a7f2c..dc13450d1e08 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) | |||
543 | */ | 543 | */ |
544 | static void __update_default_selected(struct port *port) | 544 | static void __update_default_selected(struct port *port) |
545 | { | 545 | { |
546 | // validate the port | ||
547 | if (port) { | 546 | if (port) { |
547 | const struct port_params *admin = &port->partner_admin; | ||
548 | const struct port_params *oper = &port->partner_oper; | ||
549 | |||
548 | // check if any parameter is different | 550 | // check if any parameter is different |
549 | if ((port->partner_admin.port_number != port->partner_oper.port_number) || | 551 | if (admin->port_number != oper->port_number |
550 | (port->partner_admin.port_priority != port->partner_oper.port_priority) || | 552 | || admin->port_priority != oper->port_priority |
551 | MAC_ADDRESS_COMPARE(&(port->partner_admin.system), &(port->partner_oper.system)) || | 553 | || MAC_ADDRESS_COMPARE(&admin->system, &oper->system) |
552 | (port->partner_admin.system_priority != port->partner_oper.system_priority) || | 554 | || admin->system_priority != oper->system_priority |
553 | (port->partner_admin.key != port->partner_oper.key) || | 555 | || admin->key != oper->key |
554 | ((port->partner_admin.port_state & AD_STATE_AGGREGATION) != (port->partner_oper.port_state & AD_STATE_AGGREGATION)) | 556 | || (admin->port_state & AD_STATE_AGGREGATION) |
555 | ) { | 557 | != (oper->port_state & AD_STATE_AGGREGATION)) { |
556 | // update the state machine Selected variable | 558 | // update the state machine Selected variable |
557 | port->sm_vars &= ~AD_PORT_SELECTED; | 559 | port->sm_vars &= ~AD_PORT_SELECTED; |
558 | } | 560 | } |