proc: consolidate per-net single_open callers
There are already 7 of them - time to kill some duplicate code.
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
diff --git a/net/ipv6/proc.c b/net/ipv6/proc.c
index cbc7e51..29c5a79 100644
--- a/net/ipv6/proc.c
+++ b/net/ipv6/proc.c
@@ -183,24 +183,7 @@
static int sockstat6_seq_open(struct inode *inode, struct file *file)
{
- int err;
- struct net *net;
-
- err = -ENXIO;
- net = get_proc_net(inode);
- if (net == NULL)
- goto err_net;
-
- err = single_open(file, sockstat6_seq_show, net);
- if (err < 0)
- goto err_open;
-
- return 0;
-
-err_open:
- put_net(net);
-err_net:
- return err;
+ return single_open_net(inode, file, sockstat6_seq_show);
}
static int sockstat6_seq_release(struct inode *inode, struct file *file)