diff options
author | Patrick McHardy <kaber@trash.net> | 2008-01-21 00:25:15 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 15:08:30 -0800 |
commit | 69ab4b7d6db68396dbfa827daa8d6f30f9b546a8 (patch) | |
tree | 5c87d44dc524774f553f8214dad13194fef89958 /net/8021q/vlanproc.c | |
parent | 198a291ce3a9103f4738600e3cf5416b66e009d9 (diff) | |
download | lwn-69ab4b7d6db68396dbfa827daa8d6f30f9b546a8.tar.gz lwn-69ab4b7d6db68396dbfa827daa8d6f30f9b546a8.zip |
[VLAN]: Clean up initialization code
- move module init/exit functions to end of file, remove some now unnecessary
forward declarations
- remove some obvious comments
- clean up proc init function and move a proc-related printk there
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/8021q/vlanproc.c')
-rw-r--r-- | net/8021q/vlanproc.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/net/8021q/vlanproc.c b/net/8021q/vlanproc.c index 5da02e29a2c6..971e6233801e 100644 --- a/net/8021q/vlanproc.c +++ b/net/8021q/vlanproc.c @@ -158,15 +158,18 @@ void vlan_proc_cleanup(void) int __init vlan_proc_init(void) { proc_vlan_dir = proc_mkdir(name_root, init_net.proc_net); - if (proc_vlan_dir) { - proc_vlan_conf = create_proc_entry(name_conf, - S_IFREG|S_IRUSR|S_IWUSR, - proc_vlan_dir); - if (proc_vlan_conf) { - proc_vlan_conf->proc_fops = &vlan_fops; - return 0; - } - } + if (!proc_vlan_dir) + goto err; + + proc_vlan_conf = create_proc_entry(name_conf, S_IFREG|S_IRUSR|S_IWUSR, + proc_vlan_dir); + if (!proc_vlan_conf) + goto err; + proc_vlan_conf->proc_fops = &vlan_fops; + return 0; + +err: + pr_err("%s: can't create entry in proc filesystem!\n", __FUNCTION__); vlan_proc_cleanup(); return -ENOBUFS; } |