mirror of
https://github.com/torvalds/linux.git
synced 2024-12-26 04:42:12 +00:00
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:
parent
157550fbbb
commit
21f374c6cf
@ -2379,17 +2379,16 @@ int __bond_3ad_get_active_agg_info(struct bonding *bond,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aggregator) {
|
if (!aggregator)
|
||||||
ad_info->aggregator_id = aggregator->aggregator_identifier;
|
return -1;
|
||||||
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;
|
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 */
|
/* Wrapper used to hold bond->lock so no slave manipulation can occur */
|
||||||
|
Loading…
Reference in New Issue
Block a user