diff options
author | Christoph Hellwig <hch@lst.de> | 2018-04-13 13:44:18 -0400 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2018-05-16 01:23:35 -0400 |
commit | fddda2b7b521185f3aa018f9559eb33b0aee53a9 (patch) | |
tree | ece18b3d82822f8eaefd8b0afa2f93307e83b253 /fs/proc/interrupts.c | |
parent | 7aed53d1dfd14d468e065212ce45068e2b50c1fa (diff) |
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 'fs/proc/interrupts.c')
-rw-r--r-- | fs/proc/interrupts.c | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/fs/proc/interrupts.c b/fs/proc/interrupts.c index 6a6bee9c603c..cb0edc7cbf09 100644 --- a/fs/proc/interrupts.c +++ b/fs/proc/interrupts.c | |||
@@ -34,21 +34,9 @@ static const struct seq_operations int_seq_ops = { | |||
34 | .show = show_interrupts | 34 | .show = show_interrupts |
35 | }; | 35 | }; |
36 | 36 | ||
37 | static int interrupts_open(struct inode *inode, struct file *filp) | ||
38 | { | ||
39 | return seq_open(filp, &int_seq_ops); | ||
40 | } | ||
41 | |||
42 | static const struct file_operations proc_interrupts_operations = { | ||
43 | .open = interrupts_open, | ||
44 | .read = seq_read, | ||
45 | .llseek = seq_lseek, | ||
46 | .release = seq_release, | ||
47 | }; | ||
48 | |||
49 | static int __init proc_interrupts_init(void) | 37 | static int __init proc_interrupts_init(void) |
50 | { | 38 | { |
51 | proc_create("interrupts", 0, NULL, &proc_interrupts_operations); | 39 | proc_create_seq("interrupts", 0, NULL, &int_seq_ops); |
52 | return 0; | 40 | return 0; |
53 | } | 41 | } |
54 | fs_initcall(proc_interrupts_init); | 42 | fs_initcall(proc_interrupts_init); |