Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Joe Perches and committed by
David S. Miller
21f374c6 157550fb

+9 -10
+9 -10
drivers/net/bonding/bond_3ad.c
··· 2379 2379 } 2380 2380 } 2381 2381 2382 - if (aggregator) { 2383 - ad_info->aggregator_id = aggregator->aggregator_identifier; 2384 - ad_info->ports = aggregator->num_of_ports; 2385 - ad_info->actor_key = aggregator->actor_oper_aggregator_key; 2386 - ad_info->partner_key = aggregator->partner_oper_aggregator_key; 2387 - ether_addr_copy(ad_info->partner_system, 2388 - aggregator->partner_system.mac_addr_value); 2389 - return 0; 2390 - } 2382 + if (!aggregator) 2383 + return -1; 2391 2384 2392 - return -1; 2385 + ad_info->aggregator_id = aggregator->aggregator_identifier; 2386 + ad_info->ports = aggregator->num_of_ports; 2387 + ad_info->actor_key = aggregator->actor_oper_aggregator_key; 2388 + ad_info->partner_key = aggregator->partner_oper_aggregator_key; 2389 + ether_addr_copy(ad_info->partner_system, 2390 + aggregator->partner_system.mac_addr_value); 2391 + return 0; 2393 2392 } 2394 2393 2395 2394 /* Wrapper used to hold bond->lock so no slave manipulation can occur */