diff options
author | Christoph Hellwig <hch@lst.de> | 2018-04-24 11:05:17 -0400 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2018-05-16 01:23:35 -0400 |
commit | 44414d82cfe0f68cb59d0a42f599ccd893ae0032 (patch) | |
tree | f89c89cf2f7c919c22bcf3dac566c89eac6d2ff4 /net/appletalk/aarp.c | |
parent | fddda2b7b521185f3aa018f9559eb33b0aee53a9 (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 'net/appletalk/aarp.c')
-rw-r--r-- | net/appletalk/aarp.c | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/net/appletalk/aarp.c b/net/appletalk/aarp.c index d4c1021e74e1..49a16cee2aae 100644 --- a/net/appletalk/aarp.c +++ b/net/appletalk/aarp.c | |||
@@ -907,11 +907,6 @@ void aarp_device_down(struct net_device *dev) | |||
907 | } | 907 | } |
908 | 908 | ||
909 | #ifdef CONFIG_PROC_FS | 909 | #ifdef CONFIG_PROC_FS |
910 | struct aarp_iter_state { | ||
911 | int bucket; | ||
912 | struct aarp_entry **table; | ||
913 | }; | ||
914 | |||
915 | /* | 910 | /* |
916 | * Get the aarp entry that is in the chain described | 911 | * Get the aarp entry that is in the chain described |
917 | * by the iterator. | 912 | * by the iterator. |
@@ -1033,25 +1028,12 @@ static int aarp_seq_show(struct seq_file *seq, void *v) | |||
1033 | return 0; | 1028 | return 0; |
1034 | } | 1029 | } |
1035 | 1030 | ||
1036 | static const struct seq_operations aarp_seq_ops = { | 1031 | const struct seq_operations aarp_seq_ops = { |
1037 | .start = aarp_seq_start, | 1032 | .start = aarp_seq_start, |
1038 | .next = aarp_seq_next, | 1033 | .next = aarp_seq_next, |
1039 | .stop = aarp_seq_stop, | 1034 | .stop = aarp_seq_stop, |
1040 | .show = aarp_seq_show, | 1035 | .show = aarp_seq_show, |
1041 | }; | 1036 | }; |
1042 | |||
1043 | static int aarp_seq_open(struct inode *inode, struct file *file) | ||
1044 | { | ||
1045 | return seq_open_private(file, &aarp_seq_ops, | ||
1046 | sizeof(struct aarp_iter_state)); | ||
1047 | } | ||
1048 | |||
1049 | const struct file_operations atalk_seq_arp_fops = { | ||
1050 | .open = aarp_seq_open, | ||
1051 | .read = seq_read, | ||
1052 | .llseek = seq_lseek, | ||
1053 | .release = seq_release_private, | ||
1054 | }; | ||
1055 | #endif | 1037 | #endif |
1056 | 1038 | ||
1057 | /* General module cleanup. Called from cleanup_module() in ddp.c. */ | 1039 | /* General module cleanup. Called from cleanup_module() in ddp.c. */ |