Declare the show function in PROC_FILE_DEFINE() and let procfs open and free the seq_file. That makes the open functions unnecessary.
Signed-off-by: Christian Brauner (Amutable) <[email protected]> --- fs/smb/client/cifs_debug.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/fs/smb/client/cifs_debug.c b/fs/smb/client/cifs_debug.c index dfcd2cdbb2a8..664072ab3342 100644 --- a/fs/smb/client/cifs_debug.c +++ b/fs/smb/client/cifs_debug.c @@ -873,16 +873,9 @@ static int name##_proc_show(struct seq_file *m, void *v) \ seq_printf(m, "%d\n", name); \ return 0; \ } \ -static int name##_open(struct inode *inode, struct file *file) \ -{ \ - return single_open(file, name##_proc_show, NULL); \ -} \ \ static const struct proc_ops cifs_##name##_proc_fops = { \ - .proc_open = name##_open, \ - .proc_read = seq_read, \ - .proc_lseek = seq_lseek, \ - .proc_release = single_release, \ + .proc_show = name##_proc_show, \ .proc_write = name##_write, \ } -- 2.53.0
