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>
This commit is contained in:
Joe Perches
2014-02-18 09:42:47 -08:00
committed by David S. Miller
parent 157550fbbb
commit 21f374c6cf

View File

@ -2379,7 +2379,9 @@ int __bond_3ad_get_active_agg_info(struct bonding *bond,
} }
} }
if (aggregator) { if (!aggregator)
return -1;
ad_info->aggregator_id = aggregator->aggregator_identifier; ad_info->aggregator_id = aggregator->aggregator_identifier;
ad_info->ports = aggregator->num_of_ports; ad_info->ports = aggregator->num_of_ports;
ad_info->actor_key = aggregator->actor_oper_aggregator_key; ad_info->actor_key = aggregator->actor_oper_aggregator_key;
@ -2389,9 +2391,6 @@ int __bond_3ad_get_active_agg_info(struct bonding *bond,
return 0; return 0;
} }
return -1;
}
/* Wrapper used to hold bond->lock so no slave manipulation can occur */ /* Wrapper used to hold bond->lock so no slave manipulation can occur */
int bond_3ad_get_active_agg_info(struct bonding *bond, struct ad_info *ad_info) int bond_3ad_get_active_agg_info(struct bonding *bond, struct ad_info *ad_info)
{ {