WSL2-Linux-Kernel/drivers/oprofile
Stephen Boyd 234e340582 simple_open: automatically convert to simple_open()
Many users of debugfs copy the implementation of default_open() when
they want to support a custom read/write function op.  This leads to a
proliferation of the default_open() implementation across the entire
tree.

Now that the common implementation has been consolidated into libfs we
can replace all the users of this function with simple_open().

This replacement was done with the following semantic patch:

<smpl>
@ open @
identifier open_f != simple_open;
identifier i, f;
@@
-int open_f(struct inode *i, struct file *f)
-{
(
-if (i->i_private)
-f->private_data = i->i_private;
|
-f->private_data = i->i_private;
)
-return 0;
-}

@ has_open depends on open @
identifier fops;
identifier open.open_f;
@@
struct file_operations fops = {
...
-.open = open_f,
+.open = simple_open,
...
};
</smpl>

[akpm@linux-foundation.org: checkpatch fixes]
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-04-05 15:25:50 -07:00
..
buffer_sync.c oprofile: Fix locking dependency in sync_start() 2011-05-31 16:33:34 +02:00
buffer_sync.h
cpu_buffer.c oprofile: Introduce new oprofile sample add function (oprofile_add_ext_hw_sample) 2011-02-15 11:07:07 +01:00
cpu_buffer.h oprofile: Remove deprecated use of flush_scheduled_work() 2010-10-29 11:54:18 +02:00
event_buffer.c locking, oprofile: Annotate oprofilefs lock as raw 2011-09-13 11:12:05 +02:00
event_buffer.h oprofile: Use linux/mutex.h 2011-05-24 12:45:59 +02:00
nmi_timer_int.c oprofile, x86: Reimplement nmi timer mode using perf event 2011-11-04 16:27:18 +01:00
oprof.c oprofile, x86: Reimplement nmi timer mode using perf event 2011-11-04 16:27:18 +01:00
oprof.h oprofile: Fix oprofile_timer_exit() breakage 2011-12-07 11:16:38 +01:00
oprofile_files.c oprofile: Fix uninitialized memory access when writing to writing to oprofilefs 2011-12-19 17:18:43 +01:00
oprofile_perf.c locking, oprofile: Annotate oprofilefs lock as raw 2011-09-13 11:12:05 +02:00
oprofile_stats.c
oprofile_stats.h atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
oprofilefs.c simple_open: automatically convert to simple_open() 2012-04-05 15:25:50 -07:00
timer_int.c oprofile: Remove exit function for timer mode 2011-11-04 15:04:35 +01:00