lkml.org 
[lkml]   [2022]   [Aug]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH next-next 2/2] net: vlan: reduce indentation level in __vlan_find_dev_deep_rcu()
Date
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 <william.xuanziyang@huawei.com>
---
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
\
 
 \ /
  Last update: 2022-08-31 06:10    [W:0.056 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site