Skip to content

Commit

Permalink
bonding: Invert test
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Joe Perches authored and David S. Miller committed Feb 19, 2014
1 parent 157550f commit 21f374c
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions drivers/net/bonding/bond_3ad.c
Original file line number Diff line number Diff line change
@@ -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 */

0 comments on commit 21f374c

Please sign in to comment.