summaryrefslogtreecommitdiff
path: root/drivers/net/bonding/bond_3ad.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2014-02-18 09:42:47 -0800
committerDavid S. Miller <davem@davemloft.net>2014-02-19 15:37:51 -0500
commit21f374c6cfbf98c1efceee0b528ce784d215935c (patch)
tree0a126201a245ccc65938006ea8c35ac778b1c7b6 /drivers/net/bonding/bond_3ad.c
parent157550fbbbf932970b231394b1069f50104824c5 (diff)
downloadlwn-21f374c6cfbf98c1efceee0b528ce784d215935c.tar.gz
lwn-21f374c6cfbf98c1efceee0b528ce784d215935c.zip
bonding: Invert test
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> Reviewed-by: Ding Tianhong <dingtianhong@huawei.com> 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.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
index 87348411bafe..f04f3625e944 100644
--- a/drivers/net/bonding/bond_3ad.c
+++ b/drivers/net/bonding/bond_3ad.c
@@ -2379,17 +2379,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 */