lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening linux-cve-announce PHC | |
Open Source and information security mailing list archives
| ||
|
Message-ID: <917c41381e1155eefe84c610585c487d8073166f.1661916732.git.william.xuanziyang@huawei.com> Date: Wed, 31 Aug 2022 12:09:57 +0800 From: Ziyang Xuan <william.xuanziyang@...wei.com> To: <davem@...emloft.net>, <edumazet@...gle.com>, <kuba@...nel.org>, <pabeni@...hat.com>, <morbo@...gle.com>, <netdev@...r.kernel.org> CC: <linux-kernel@...r.kernel.org> 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 <william.xuanziyang@...wei.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
Powered by blists - more mailing lists