Skip to contentSkip to conversation

bonding: simplify conditionals

PATCH New Nicolas Kaiser 1 participant 1 message Oct 5, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bonding: simplify conditionals

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

---
 drivers/net/bonding/bond_3ad.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
drivers/net/bonding/bond_3ad.c +3 -4
index 0ddf4c6..d0ad321 100644
@@ -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;
 			}
Signature · 1 line
1.7.2.2