diff options
author | Christoph Hellwig <hch@lst.de> | 2018-04-13 19:44:18 +0200 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2018-05-16 07:23:35 +0200 |
commit | fddda2b7b521185f3aa018f9559eb33b0aee53a9 (patch) | |
tree | ece18b3d82822f8eaefd8b0afa2f93307e83b253 /net/llc | |
parent | 7aed53d1dfd14d468e065212ce45068e2b50c1fa (diff) | |
download | linux-fddda2b7b521185f3aa018f9559eb33b0aee53a9.tar.bz2 |
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 <hch@lst.de>
Diffstat (limited to 'net/llc')
-rw-r--r-- | net/llc/llc_proc.c | 28 |
1 files changed, 2 insertions, 26 deletions
diff --git a/net/llc/llc_proc.c b/net/llc/llc_proc.c index 62ea0aed94b4..f3a36c16a5e7 100644 --- a/net/llc/llc_proc.c +++ b/net/llc/llc_proc.c @@ -214,30 +214,6 @@ static const struct seq_operations llc_seq_core_ops = { .show = llc_seq_core_show, }; -static int llc_seq_socket_open(struct inode *inode, struct file *file) -{ - return seq_open(file, &llc_seq_socket_ops); -} - -static int llc_seq_core_open(struct inode *inode, struct file *file) -{ - return seq_open(file, &llc_seq_core_ops); -} - -static const struct file_operations llc_seq_socket_fops = { - .open = llc_seq_socket_open, - .read = seq_read, - .llseek = seq_lseek, - .release = seq_release, -}; - -static const struct file_operations llc_seq_core_fops = { - .open = llc_seq_core_open, - .read = seq_read, - .llseek = seq_lseek, - .release = seq_release, -}; - static struct proc_dir_entry *llc_proc_dir; int __init llc_proc_init(void) @@ -249,11 +225,11 @@ int __init llc_proc_init(void) if (!llc_proc_dir) goto out; - p = proc_create("socket", 0444, llc_proc_dir, &llc_seq_socket_fops); + p = proc_create_seq("socket", 0444, llc_proc_dir, &llc_seq_socket_ops); if (!p) goto out_socket; - p = proc_create("core", 0444, llc_proc_dir, &llc_seq_core_fops); + p = proc_create_seq("core", 0444, llc_proc_dir, &llc_seq_core_ops); if (!p) goto out_core; |