提交 21f374c6 编写于 作者: J Joe Perches 提交者: David S. Miller

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: NJoe Perches <joe@perches.com>
Reviewed-by: NDing Tianhong <dingtianhong@huawei.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 157550fb
...@@ -2379,7 +2379,9 @@ int __bond_3ad_get_active_agg_info(struct bonding *bond, ...@@ -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;
...@@ -2387,9 +2389,6 @@ int __bond_3ad_get_active_agg_info(struct bonding *bond, ...@@ -2387,9 +2389,6 @@ int __bond_3ad_get_active_agg_info(struct bonding *bond,
ether_addr_copy(ad_info->partner_system, ether_addr_copy(ad_info->partner_system,
aggregator->partner_system.mac_addr_value); aggregator->partner_system.mac_addr_value);
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 */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册