public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nicolas Kaiser <nikai@nikai.net>
To: Jay Vosburgh <fubar@us.ibm.com>
Cc: bonding-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: [PATCH] bonding: simplify conditionals
Date: Tue, 5 Oct 2010 20:41:49 +0200	[thread overview]
Message-ID: <20101005204149.6a43d080@absol.kitzblitz> (raw)

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

Signed-off-by: Nicolas Kaiser <nikai@nikai.net>
---
 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

                 reply	other threads:[~2010-10-05 18:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101005204149.6a43d080@absol.kitzblitz \
    --to=nikai@nikai.net \
    --cc=bonding-devel@lists.sourceforge.net \
    --cc=fubar@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox