1 // SPDX-License-Identifier: GPL-2.0
2 /// Remove an open coded simple_open() function
3 /// and replace file operations references to the function
4 /// with simple_open() instead.
8 // Options: --no-includes --include-headers
13 @ open depends on patch @
14 identifier open_f != simple_open;
17 -int open_f(struct inode *i, struct file *f)
21 -f->private_data = i->i_private;
23 -f->private_data = i->i_private;
28 @ has_open depends on open @
30 identifier open.open_f;
32 struct file_operations fops = {
39 @ openr depends on report @
40 identifier open_f != simple_open;
44 int open_f@p(struct inode *i, struct file *f)
48 f->private_data = i->i_private;
50 f->private_data = i->i_private;
55 @ has_openr depends on openr @
57 identifier openr.open_f;
60 struct file_operations fops = {
71 coccilib.report.print_report(pf[0],"WARNING opportunity for simple_open, see also structure on line %s"%(ps[0].line))