From fddda2b7b521185f3aa018f9559eb33b0aee53a9 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Fri, 13 Apr 2018 19:44:18 +0200 Subject: proc: introduce proc_create_seq{,_data} Variants of proc_create{,_data} that directly take a struct seq_operations argument and drastically reduces the boilerplate code in the callers. All trivial callers converted over. Signed-off-by: Christoph Hellwig --- net/netrom/af_netrom.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'net/netrom/af_netrom.c') diff --git a/net/netrom/af_netrom.c b/net/netrom/af_netrom.c index 4221d98a314b..c2888c78d4c1 100644 --- a/net/netrom/af_netrom.c +++ b/net/netrom/af_netrom.c @@ -1338,18 +1338,6 @@ static const struct seq_operations nr_info_seqops = { .stop = nr_info_stop, .show = nr_info_show, }; - -static int nr_info_open(struct inode *inode, struct file *file) -{ - return seq_open(file, &nr_info_seqops); -} - -static const struct file_operations nr_info_fops = { - .open = nr_info_open, - .read = seq_read, - .llseek = seq_lseek, - .release = seq_release, -}; #endif /* CONFIG_PROC_FS */ static const struct net_proto_family nr_family_ops = { @@ -1450,9 +1438,9 @@ static int __init nr_proto_init(void) nr_loopback_init(); - proc_create("nr", 0444, init_net.proc_net, &nr_info_fops); - proc_create("nr_neigh", 0444, init_net.proc_net, &nr_neigh_fops); - proc_create("nr_nodes", 0444, init_net.proc_net, &nr_nodes_fops); + proc_create_seq("nr", 0444, init_net.proc_net, &nr_info_seqops); + proc_create_seq("nr_neigh", 0444, init_net.proc_net, &nr_neigh_seqops); + proc_create_seq("nr_nodes", 0444, init_net.proc_net, &nr_node_seqops); out: return rc; fail: -- cgit v1.2.3