2022-08-31 04:14:46

by Ziyang Xuan (William)

[permalink] [raw]
Subject: [PATCH next-next 2/2] net: vlan: reduce indentation level in __vlan_find_dev_deep_rcu()

If vlan_info is NULL in __vlan_find_dev_deep_rcu(), else { ... } is
unnecessary. Remove it to reduce indentation level.

Signed-off-by: Ziyang Xuan <[email protected]>
---
net/8021q/vlan_core.c | 22 +++++++++-------------
1 file changed, 9 insertions(+), 13 deletions(-)

diff --git a/net/8021q/vlan_core.c b/net/8021q/vlan_core.c
index 5aa8144101dc..027d4ebed9c0 100644
--- a/net/8021q/vlan_core.c
+++ b/net/8021q/vlan_core.c
@@ -77,23 +77,19 @@ struct net_device *__vlan_find_dev_deep_rcu(struct net_device *dev,
__be16 vlan_proto, u16 vlan_id)
{
struct vlan_info *vlan_info = rcu_dereference(dev->vlan_info);
+ struct net_device *upper_dev;

- if (vlan_info) {
+ if (vlan_info)
return vlan_group_get_device(&vlan_info->grp,
vlan_proto, vlan_id);
- } else {
- /*
- * Lower devices of master uppers (bonding, team) do not have
- * grp assigned to themselves. Grp is assigned to upper device
- * instead.
- */
- struct net_device *upper_dev;

- upper_dev = netdev_master_upper_dev_get_rcu(dev);
- if (upper_dev)
- return __vlan_find_dev_deep_rcu(upper_dev,
- vlan_proto, vlan_id);
- }
+ /* Lower devices of master uppers (bonding, team) do not have
+ * grp assigned to themselves. Grp is assigned to upper device
+ * instead.
+ */
+ upper_dev = netdev_master_upper_dev_get_rcu(dev);
+ if (upper_dev)
+ return __vlan_find_dev_deep_rcu(upper_dev, vlan_proto, vlan_id);

return NULL;
}
--
2.25.1