diff mbox series

[next-next,1/2] net: vlan: remove unnecessary err variable in vlan_init_net()

Message ID e68a18f6bfeeb5d05c1506da65f308e8e3d29013.1661916732.git.william.xuanziyang@huawei.com (mailing list archive)
State Rejected
Delegated to: Netdev Maintainers
Headers show
Series net: vlan: two small refactors to make code more concise | expand

Checks

Context Check Description
netdev/tree_selection success Guessed tree name to be net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cover_letter success Series has a cover letter
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers success CCed 6 of 6 maintainers
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 14 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Ziyang Xuan (William) Aug. 31, 2022, 4:09 a.m. UTC
Return vlan_init_net() directly in vlan_init_net(), remove unnecessary
err variable. Thus code looks more concise.

Signed-off-by: Ziyang Xuan <william.xuanziyang@huawei.com>
---
 net/8021q/vlan.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
index e40aa3e3641c..aaef80fdd852 100644
--- a/net/8021q/vlan.c
+++ b/net/8021q/vlan.c
@@ -658,13 +658,10 @@  static int vlan_ioctl_handler(struct net *net, void __user *arg)
 static int __net_init vlan_init_net(struct net *net)
 {
 	struct vlan_net *vn = net_generic(net, vlan_net_id);
-	int err;
 
 	vn->name_type = VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD;
 
-	err = vlan_proc_init(net);
-
-	return err;
+	return vlan_proc_init(net);
 }
 
 static void __net_exit vlan_exit_net(struct net *net)