From: Joe Perches <joe@perches.com>
To: netdev@vger.kernel.org
Cc: Jay Vosburgh <fubar@us.ibm.com>,
Veaceslav Falico <vfalico@redhat.com>,
Andy Gospodarek <andy@greyhouse.net>,
linux-kernel@vger.kernel.org
Subject: [PATCH net-next 3/3] bonding: Invert test
Date: Tue, 18 Feb 2014 09:42:47 -0800 [thread overview]
Message-ID: <63cf685f6be365b2eff54db6bc1c6a3939983bd7.1392745014.git.joe@perches.com> (raw)
In-Reply-To: <cover.1392745013.git.joe@perches.com>
Make the error case return early.
Make the normal return at the bottom of the function.
Reduces indent for readability.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/bonding/bond_3ad.c | 21 ++++++++++-----------
1 file changed, 10 insertions(+), 11 deletions(-)
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
index 7cb51f9..a0e12369 100644
--- a/drivers/net/bonding/bond_3ad.c
+++ b/drivers/net/bonding/bond_3ad.c
@@ -2381,17 +2381,16 @@ int __bond_3ad_get_active_agg_info(struct bonding *bond,
}
}
- if (aggregator) {
- ad_info->aggregator_id = aggregator->aggregator_identifier;
- ad_info->ports = aggregator->num_of_ports;
- ad_info->actor_key = aggregator->actor_oper_aggregator_key;
- ad_info->partner_key = aggregator->partner_oper_aggregator_key;
- ether_addr_copy(ad_info->partner_system,
- aggregator->partner_system.mac_addr_value);
- return 0;
- }
-
- return -1;
+ if (!aggregator)
+ return -1;
+
+ ad_info->aggregator_id = aggregator->aggregator_identifier;
+ ad_info->ports = aggregator->num_of_ports;
+ ad_info->actor_key = aggregator->actor_oper_aggregator_key;
+ ad_info->partner_key = aggregator->partner_oper_aggregator_key;
+ ether_addr_copy(ad_info->partner_system,
+ aggregator->partner_system.mac_addr_value);
+ return 0;
}
/* Wrapper used to hold bond->lock so no slave manipulation can occur */
--
1.8.1.2.459.gbcd45b4.dirty
next prev parent reply other threads:[~2014-02-18 17:42 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-18 17:42 [PATCH net-next 0/3] bonding: More ether_addr_copy and neatenings Joe Perches
2014-02-18 17:42 ` [PATCH net-next 1/3] bonding: More use of ether_addr_copy Joe Perches
2014-02-18 17:42 ` [PATCH net-next 2/3] bonding: Remove unnecessary else Joe Perches
2014-02-18 17:42 ` Joe Perches [this message]
2014-02-19 1:44 ` [PATCH net-next 0/3] bonding: More ether_addr_copy and neatenings Ding Tianhong
2014-02-19 20:38 ` David Miller
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=63cf685f6be365b2eff54db6bc1c6a3939983bd7.1392745014.git.joe@perches.com \
--to=joe@perches.com \
--cc=andy@greyhouse.net \
--cc=fubar@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=vfalico@redhat.com \
/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