summaryrefslogtreecommitdiff
path: root/kernel/time/timer_list.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2018-04-24 17:05:17 +0200
committerChristoph Hellwig <hch@lst.de>2018-05-16 07:23:35 +0200
commit44414d82cfe0f68cb59d0a42f599ccd893ae0032 (patch)
treef89c89cf2f7c919c22bcf3dac566c89eac6d2ff4 /kernel/time/timer_list.c
parentfddda2b7b521185f3aa018f9559eb33b0aee53a9 (diff)
proc: introduce proc_create_seq_private
Variant of proc_create_data that directly take a struct seq_operations argument + a private state size 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 'kernel/time/timer_list.c')
-rw-r--r--kernel/time/timer_list.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/kernel/time/timer_list.c b/kernel/time/timer_list.c
index 0ed768b56c60..675c4e9563a9 100644
--- a/kernel/time/timer_list.c
+++ b/kernel/time/timer_list.c
@@ -372,24 +372,12 @@ static const struct seq_operations timer_list_sops = {
.show = timer_list_show,
};
-static int timer_list_open(struct inode *inode, struct file *filp)
-{
- return seq_open_private(filp, &timer_list_sops,
- sizeof(struct timer_list_iter));
-}
-
-static const struct file_operations timer_list_fops = {
- .open = timer_list_open,
- .read = seq_read,
- .llseek = seq_lseek,
- .release = seq_release_private,
-};
-
static int __init init_timer_list_procfs(void)
{
struct proc_dir_entry *pe;
- pe = proc_create("timer_list", 0400, NULL, &timer_list_fops);
+ pe = proc_create_seq_private("timer_list", 0400, NULL, &timer_list_sops,
+ sizeof(struct timer_list_iter), NULL);
if (!pe)
return -ENOMEM;
return 0;