[PATCH] bonding: simplify conditionals

From: Nicolas Kaiser
Date: Tue Oct 05 2010 - 14:46:24 EST


Simplify conditionals:
(a || (!a && !b)) => (a || !b)
(!(!a && b)) => (a || !b)

Signed-off-by: Nicolas Kaiser <nikai@xxxxxxxxx>
---
drivers/net/bonding/bond_3ad.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
index 0ddf4c6..d0ad321 100644
--- a/drivers/net/bonding/bond_3ad.c
+++ b/drivers/net/bonding/bond_3ad.c
@@ -1541,10 +1541,9 @@ static void ad_agg_selection_logic(struct aggregator *agg)
*/
if (active && active->lag_ports &&
active->lag_ports->is_enabled &&
- (__agg_has_partner(active) ||
- (!__agg_has_partner(active) && !__agg_has_partner(best)))) {
- if (!(!active->actor_oper_aggregator_key &&
- best->actor_oper_aggregator_key)) {
+ (__agg_has_partner(active) || !__agg_has_partner(best))) {
+ if (active->actor_oper_aggregator_key ||
+ !best->actor_oper_aggregator_key) {
best = NULL;
active->is_active = 1;
}
--
1.7.2.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/