Skip to content

Commit 21f374c

Browse files
JoePerchesdavem330
authored andcommitted
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 <[email protected]> Reviewed-by: Ding Tianhong <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 157550f commit 21f374c

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

drivers/net/bonding/bond_3ad.c

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2379,17 +2379,16 @@ int __bond_3ad_get_active_agg_info(struct bonding *bond,
23792379
}
23802380
}
23812381

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-
}
2391-
2392-
return -1;
2382+
if (!aggregator)
2383+
return -1;
2384+
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;
23932392
}
23942393

23952394
/* Wrapper used to hold bond->lock so no slave manipulation can occur */

0 commit comments

Comments
 (0)